@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
@@ -0,0 +1,127 @@
1
+ # Custom Labels Reference (Web and Mobile deployments)
2
+
3
+ Custom labels replace the widget's built-in text (for example the "Today" date divider) per deployment, with optional translations. They are **Tooling API records, not part of `EmbeddedServiceConfig` XML**: never add them to the generated file. Supported on Web (v1 and v2) and Mobile deployments; **API deployments have no custom labels**. They are written in Phase 2C after the deployment exists, and go live only when the deployment is published (SKILL.md step 17c).
4
+
5
+ ---
6
+
7
+ ## Inputs to Gather
8
+
9
+ - **Deployment** (API name, resolved to its `EmbeddedServiceConfig` Id)
10
+ - **Label key** — one `LabelKey` per label. Prefer `EM_*` (embedded messaging). Do not guess keys; list candidates from the describe (see Validating the Key)
11
+ - **Text** in the base language (`en_US`)
12
+ - **Translations** (optional) — pairs of language code and text
13
+
14
+ Delegated: read the key, text and translations from `intent`; ask only for what it leaves open, and never invent a key. Deployment-level labels only. You may propose candidate keys from the user's description (for example "Today divider" → `EM_Container_Base_StartBookendText`), but never pick one silently: the user names the key or confirms one from the list you show.
15
+
16
+ ---
17
+
18
+ ## Prerequisites (check in order; stop at the first failure, except an inactive translation language, see 2)
19
+
20
+ All checks are read-only. Enabling Translation Workbench or a language is an org setting: give the user the Setup step and let them apply it (delegated: `failed`, naming the unmet prerequisite). Do not change org settings here.
21
+
22
+ 1. **Translation Workbench is enabled** — required for *any* custom label to show, English-only included.
23
+ `GET /services/data/vXX.0/tooling/query?q=SELECT IsTranslationWorkbenchEnabled FROM LanguageSettings` → must be `true`. A missing row or `false` means off.
24
+ 2. **Every language the label appears in is enabled** — the base language and each translation.
25
+ `GET /services/data/vXX.0/query?q=SELECT Language, IsActive FROM Translation` (standard data API, not Tooling) → each needed code must have `IsActive = true`. The API accepts any of 224 language codes for a translation, but Setup lists only enabled ones, so a translation for a language that is not enabled is stored and cannot be seen or edited in Setup. **Do not write a `LocalizedValue` for a language that is not active**, even when told not to ask questions: write the base text only if that is valid, skip the translation, and report the Setup step to enable the language (delegated: `failed` for that translation, naming the language).
26
+ 3. **The deployment exists and its type supports labels** (contract §3 pre-scan). Read `deploymentType` from the deployment before any write, so no `ExternalString` is created and left orphaned:
27
+ - **API:** not supported. Stop and say so; write nothing (delegated: `failed`, naming the type).
28
+ - **Mobile:** only `EM_PreChat_TermsAndConditions` and `EM_Fallback_FallbackMessage` are accepted (core rule in `EmbeddedServiceCustomLabelObject`, checked on create). Any other key fails with `INVALID_INPUT: Object is not supported for this deployment type`; refuse it up front and offer those two.
29
+ - **Web (v1 and v2):** any key from the describe is accepted. See the v1/v2 warning below.
30
+
31
+ ---
32
+
33
+ ## Validating the Key
34
+
35
+ `LabelKey` on `EmbeddedServiceCustomLabel` is a restricted picklist (about 440 values). Read the valid keys from `GET /services/data/vXX.0/tooling/sobjects/EmbeddedServiceCustomLabel/describe` (field `LabelKey`, `picklistValues`); never hardcode the list. An unknown key fails the create.
36
+
37
+ | Prefix | Meaning |
38
+ |---|---|
39
+ | `EM_` | Embedded Messaging widget text. Use these |
40
+ | `LA_`, `FS_`, `CM_` | Legacy chat and other products. The API accepts them on a Web deployment, but they do not map to MIAW text. Warn before using one |
41
+
42
+ **Web v1/v2 warning.** Web v1 and v2 show different label sets in Setup. The API stores a key that belongs to the other version, but it never appears in Setup or the widget, and the org cannot be asked which keys fit which version. Do not read the client version. Before writing, tell the user once: "Setup lists different labels for Web v1 and v2. If the row does not appear under Custom Labels for this deployment, the key may belong to the other version." Do not hardcode or filter by a key list. Delegated: no question; add a one-line "verify in Setup (v1 and v2 list different labels)" note to the result and keep the status `success`.
43
+
44
+ The label sets the widget text only. Turning Terms and Conditions on or off is `isTermsAndConditionsEnabled` / `isTermsAndConditionsRequired` in the XML (SKILL.md step 15); on Mobile, `EM_PreChat_TermsAndConditions` is the text of that line.
45
+
46
+ Where a key appears in Setup: Setup → the deployment → Custom Labels, filtered by Language / Chat Group / Label Group / Label Type. For example `EM_Container_Base_StartBookendText` is the default "Today" row, Chat Group "Chat in Progress", Label Type "System Messages".
47
+
48
+ ---
49
+
50
+ ## Record Model
51
+
52
+ | Record (Tooling) | Purpose |
53
+ |---|---|
54
+ | `ExternalString` | The text: `Name`, `MasterLabel`, `Value`, `Language`, `Category` |
55
+ | `EmbeddedServiceCustomLabel` | Binds the string to the deployment: `EmbeddedServiceConfigId`, `LabelKey`, `CustomLabelId` |
56
+ | `LocalizedValue` | One translation: `ParentId` (the `ExternalString` Id), `Language`, `Value` |
57
+
58
+ **`ExternalString` shape (required).** `Category` must be `EmbeddedMessaging`; any other value, or none, makes the later publish fail. Use the shape Setup writes:
59
+
60
+ - `Name` = `MasterLabel` = `<LabelKey>_<15-char EmbeddedServiceConfigId>_<7 digits>`
61
+ - `Language` = `en_US`, `Category` = `EmbeddedMessaging`, `Value` = the text
62
+
63
+ ---
64
+
65
+ ## Create (idempotent)
66
+
67
+ 1. **Detect.** `GET /services/data/vXX.0/tooling/query?q=SELECT Id, LabelKey, CustomLabelId FROM EmbeddedServiceCustomLabel WHERE EmbeddedServiceConfigId = '<id>'`. A row for the key means **update**, not create: a second binding for the same key on a deployment fails with `DUPLICATE_VALUE`. For an existing row, read the `ExternalString` `Value` and its `LocalizedValue` rows and compare with the request; if all match, write nothing (delegated: `already-configured`, contract §3).
68
+ 2. **Create the string.** `POST /services/data/vXX.0/tooling/sobjects/ExternalString` with the shape above. Keep the returned `id`.
69
+ 3. **Bind it.** `POST /services/data/vXX.0/tooling/sobjects/EmbeddedServiceCustomLabel` with `{EmbeddedServiceConfigId, LabelKey, CustomLabelId}`. If the bind is rejected, `DELETE` the `ExternalString` from step 2 (it is left orphaned) and report the error.
70
+ 4. **Translations** (if any). `POST /services/data/vXX.0/tooling/sobjects/LocalizedValue` per language with `{ParentId, Language, Value}`.
71
+ 5. **Read back.** Query the `ExternalString` (`Value`, `Category`) and re-query the bindings to confirm what landed.
72
+
73
+ Build JSON bodies with `jq -n --arg` on the CLI path; never splice user text into a body.
74
+
75
+ ## Update
76
+
77
+ - Change the base text: `PATCH .../tooling/sobjects/ExternalString/<id>` with `{Value}`. (`sf data update record` and `dispatch` take a plain update; `sf api request rest` returns 405 on a plain `PATCH`, so avoid it.)
78
+ - Change or add a translation: `PATCH` the existing `LocalizedValue`, or `POST` one for a new language.
79
+
80
+ ## Remove
81
+
82
+ `DELETE .../tooling/sobjects/EmbeddedServiceCustomLabel/<junction id>` (no body). Deleting the binding also deletes the `ExternalString` and its translations; do not delete those separately.
83
+
84
+ ---
85
+
86
+ ## Transport
87
+
88
+ Tooling calls go through `dispatch` / `dispatch_readonly` on the raw route (`/services/data/vXX.0/tooling/...`); every call above, including `PATCH` and `DELETE`, was verified that way on the test gateway. Fall back to the `sf` CLI only on the named signals in contract §2. The CLI path was verified end to end on the test org; use `sf data ... record --use-tooling-api`, not `sf api request rest`:
89
+
90
+ | Step | Command |
91
+ |---|---|
92
+ | Read | `sf data query --use-tooling-api -q "<SOQL>"` |
93
+ | Create | `sf data create record --use-tooling-api -s <ExternalString\|EmbeddedServiceCustomLabel\|LocalizedValue> -v "Field='value' ..."` |
94
+ | Update | `sf data update record --use-tooling-api -s <sObject> -i <id> -v "Value='...'"` (plain update, no `_HttpMethod` override) |
95
+ | Remove | `sf data delete record --use-tooling-api -s EmbeddedServiceCustomLabel -i <junction id>` (cascades as above) |
96
+
97
+ With `--json`, the output can carry control characters and a CLI update warning on stdout. Strip control characters (`tr -d '\000-\010\013-\037'`) before `jq`, and read each new record's `result.id` before the next step. A duplicate bind returns "duplicate value found: EmbeddedServiceConfigId duplicates value on record with id ...". The CLI fails the same way `dispatch` does on `DUPLICATE_VALUE`, so detect first.
98
+
99
+ ---
100
+
101
+ ## Publish
102
+
103
+ Writing labels changes the draft only. Follow SKILL.md step 17c: stop, give the review link, and publish only on an explicit yes in that turn. Delegated: never publish, and always end with the contract section 5 result (`status`, `errorMessage`, `outputs` with `published: false`) as the final reply, naming what was written or which prerequisite failed. Do not end with prose only.
104
+
105
+ ---
106
+
107
+ ## Gotchas
108
+
109
+ | Issue | Resolution |
110
+ |---|---|
111
+ | Label saved but missing from the Setup language dropdown | The language is not enabled in Translation Workbench; give the Setup step |
112
+ | Label does not show at all | Translation Workbench is off, or the deployment was not republished |
113
+ | Publish fails after adding a label | `ExternalString.Category` is not `EmbeddedMessaging` |
114
+ | `DUPLICATE_VALUE` on bind | The key is already bound to this deployment; update it instead |
115
+ | `INVALID_INPUT: Object is not supported for this deployment type` | Mobile accepts only the T&C and Fallback keys; API accepts none. Delete the orphan `ExternalString` |
116
+ | Label saved but missing from the Setup Custom Labels list or the widget | The key may belong to the other Web version (v1 vs v2). Remove it and pick a key Setup shows for this deployment |
117
+ | Label shows in Setup but not the widget | Not yet republished, or the key maps to different text than expected. Check the Chat Group and Label Type rows in Setup |
118
+
119
+ ## Verification Checklist
120
+
121
+ - [ ] Translation Workbench is enabled and every needed language is `IsActive`
122
+ - [ ] Deployment type supports labels (not API; Mobile only the two keys); `LabelKey` is in the describe's picklist (prefer `EM_*`)
123
+ - [ ] Web: the v1/v2 warning was given and the Setup review link asks the user to confirm the row
124
+ - [ ] `ExternalString` has `Category = EmbeddedMessaging` and the Setup-shaped `Name` (confirmed by read-back, not assumed)
125
+ - [ ] Exactly one `EmbeddedServiceCustomLabel` per key for the deployment (re-query after the writes)
126
+ - [ ] Labels were not added to `EmbeddedServiceConfig` XML
127
+ - [ ] Publish waited for an explicit yes; the Setup review link was given
@@ -112,7 +112,8 @@ Available since API v58.0. Repeatable. Configures conditions under which the mes
112
112
  | Create any ESD (Web) | No | No | Yes |
113
113
  | Create any ESD (API/Mobile) | Yes | No | Yes |
114
114
  | Update ESD (top-level + channel settings) | Yes | Yes | No |
115
- | Update ESD (forms/labels) | Yes | No | No |
115
+ | Update ESD (forms) | Yes | No | No |
116
+ | Custom labels (not in `EmbeddedServiceConfig` XML) | No | Yes | No |
116
117
  | Create BrandingSet | No (auto-created by Connect API) | No | Yes |
117
118
  | Update BrandingSet properties | No | Yes | No |
118
119
  | Publish ESD | No | No | Yes |
@@ -1,6 +1,6 @@
1
1
  # Onboarding contract — delegated mode, transport, pre-scan, registration
2
2
 
3
- Read this when the invocation carries a `context` object, when you are about to write to the org, or when the
3
+ Read this when `delegationFrom` is set on the invocation, when you are about to write to the org, or when the
4
4
  skill is being registered in an onboarding module. It implements the Feature Setup Skill Guidelines (Conversational
5
5
  Onboarding, Service Cloud) for this skill.
6
6
 
@@ -8,33 +8,27 @@ Onboarding, Service Cloud) for this skill.
8
8
 
9
9
  | | Delegated | Standalone |
10
10
  |---|---|---|
11
- | Detected by | invocation has `context.calledFrom == "service-onboarding"` | no `context` object |
12
- | Values come from | `values` in the payload — already approved in the plan table | you ask, using the defaults in SKILL.md |
13
- | Questions | none. A missing required key is a caller bug: stop and report `failed` naming the key. Never default a value the admin did not approve | the Clarifying Questions in SKILL.md |
14
- | Wording | `discoveryMode == "guided"` → plain business language (§4). `"pickAreas"` → Salesforce terminology | Salesforce terminology (the Clarifying Questions as written) |
15
- | Ends with | the structured result in section 5 | a plain-language summary of the same outcome |
11
+ | Detected by | `delegationFrom == "service-onboarding"` (alias until onboarding drops it: `context.calledFrom == "service-onboarding"`) | `delegationFrom` absent |
12
+ | Values come from | `intent` — prose citing the facts the admin already approved in the plan. Read every input from it first | you ask, using the defaults in SKILL.md |
13
+ | Questions | ask only for an input the `intent` leaves open. Never fabricate or default a value the admin did not approve. Invalid shell input or an unknown channel is `failed` | the Clarifying Questions in SKILL.md |
14
+ | Wording | `discoveryMode == "guided"` → plain business language (§4). Any other mode → Salesforce terminology | Salesforce terminology (the Clarifying Questions as written) |
15
+ | Ends with | the structured result in section 5, then stop: no "what next?", no onward delegation | a plain-language summary of the same outcome |
16
16
 
17
17
  Both paths converge on the same pre-scan → write → validate procedure. The only difference is where values come from.
18
18
 
19
- Delegated payload:
19
+ Delegated runtime values (shared rules: the Service-Onboarding delegation guidelines linked from SKILL.md):
20
20
 
21
21
  ```json
22
22
  {
23
- "values": {
24
- "operation": "create",
25
- "deploymentType": "Web",
26
- "deploymentName": "Acme Support Chat",
27
- "channelName": "Acme_Support_Channel",
28
- "siteName": "ESW_AcmeSupport_1700000000000"
29
- },
30
- "context": { "calledFrom": "service-onboarding", "discoveryMode": "guided" }
23
+ "intent": "Create a Web embedded messaging deployment 'Acme Support Chat' linked to channel Acme_Support_Channel.",
24
+ "delegationFrom": "service-onboarding",
25
+ "discoveryMode": "guided"
31
26
  }
32
27
  ```
33
28
 
34
- Required `values`: `deploymentName`, `deploymentType`, `channelName`. `deploymentName` is the label; the API name is
35
- derived from it (SKILL.md Required Inputs: `Acme Support Chat` → `Acme_Support_Chat`). `operation` defaults to `create` when the pre-scan
36
- finds nothing and `update` when it finds a deployment. `siteName` is required for Web updates. Optional feature keys
37
- (pre-chat fields, business hours, T&C, branding) are applied only when present — do not invent them.
29
+ Inputs to read from `intent`: `deploymentName`, `deploymentType`, `channelName` (required). `deploymentName` is the label; the API name is
30
+ derived from it (SKILL.md Required Inputs: `Acme Support Chat` → `Acme_Support_Chat`). The operation is `create` when the pre-scan
31
+ finds nothing and `update` when it finds a deployment. A Web update needs the site name. Optional features (pre-chat fields, custom labels, business hours, T&C, branding) are applied only when `intent` states them — do not invent them.
38
32
 
39
33
  ## 2. Transport — `/headless/metadata` first, `sf` CLI as fallback
40
34
 
@@ -59,16 +53,19 @@ Metadata-CRUD route, fully-qualified: `/services/data/vXX.0/headless/metadata/<T
59
53
  | `xmlRep` returned, or "Metadata not found" style error | type is onboarded | Transport A |
60
54
  | `UNSUPPORTED_OPERATION` for the type or verb | not onboarded for that verb | Transport B for that call only |
61
55
  | auth / connection error | MCP unavailable | Transport B; say so |
56
+ | `dispatch` not in your tool list | tool not loaded yet | try to load it (e.g. ToolSearch), then probe again. No tool-loading tool, or the load fails: Transport B for that call; quote the failure |
62
57
 
63
58
  **Transport B (fallback): `sf` CLI** — the retrieve/deploy commands already in SKILL.md. Use it only when the probe
64
59
  says Transport A is unavailable for that type/verb, never as a convenience.
65
60
 
66
61
  What is not a transport choice:
67
- - **Web deployment creation is a Connect API call — send it with `sf api request rest`, not `dispatch`.** Through
68
- `dispatch` it always fails with an `INTERNAL_ERROR` server error while building the ESW site; the same body via the CLI
69
- succeeds. Do not try `dispatch` first.
62
+ - **Web deployment creation is a Connect API call — try `dispatch` first.** It can fail with an `INTERNAL_ERROR` server
63
+ error while the ESW site is built (MCP sessions have no session key). That error is the signal to re-run the pre-scan
64
+ and send the same body with `sf api request rest` (Transport B for that call only); any other error is not.
70
65
  - **Publish is a Connect API call**, sent per SKILL.md step 17c (`dispatch`, `sf api request rest` on a route error).
71
- - **Tooling API** work (custom labels, branding, reCAPTCHA) goes through the `sf` CLI, not `dispatch`.
66
+ - **Tooling API** work: custom labels use `dispatch` on the raw `/tooling/` route (verified on the test gateway), `sf` CLI only on the signals above. Branding and reCAPTCHA go through the `sf` CLI.
67
+
68
+ **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").
72
69
 
73
70
  ## 3. Pre-scan (idempotency)
74
71
 
@@ -81,6 +78,8 @@ Run before any write, both modes. Read `EmbeddedServiceConfig` by `fullName` = t
81
78
  | Exists, some targeted field differs | **drift** — announce each change ("pre-chat form: on → off"), then write. Standalone: ask for a yes first. Delegated: the plan approval covers it |
82
79
  | Exists but links a different channel than `channelName` | Standalone: ask before repointing. Delegated: return `failed`, `errorMessage` = "deployment <name> already uses channel <other>" |
83
80
 
81
+ **Custom labels are not in this XML**, so the comparison above cannot see them. When labels are requested, compare them separately (`references/custom_labels.md` §Create step 1: query the deployment's bindings and compare key and text). A deployment whose XML already matches still proceeds to the label writes; return `already-configured` only when the XML and every requested label match. A missing label prerequisite, an API deployment, or a Mobile key other than the T&C or Fallback key is `failed`, naming it.
82
+
84
83
  Standalone, deployment exists: offer exactly three choices — no change / override / add to existing.
85
84
 
86
85
  The metadata read does not say whether the latest edits are **published**. A Web create auto-publishes: return `published: true` when `isPublishSuccess=true`. Updates stay draft, so return `published: false` and the coordinator asks the admin to publish (SKILL.md step 17c).
@@ -130,13 +129,13 @@ On `failed`: `errorMessage` names the failed step and the platform error; stop;
130
129
  deploymentType: { from: signal.messagingSurface, default: "Web" }
131
130
  deploymentName: { from: signal.messagingWidgetName, default: "<company> Support Chat" }
132
131
  channelName: { from: outputs.messagingChannel.channelName }
133
- writes: "EmbeddedServiceConfig (Metadata CRUD); Web create via Connect API embeddedmessaging/deployment/setup (sf CLI); publish via Connect API; optional BrandingSet / custom labels via Tooling API"
132
+ writes: "EmbeddedServiceConfig (Metadata CRUD); Web create via Connect API embeddedmessaging/deployment/setup (dispatch, sf CLI on INTERNAL_ERROR); publish via Connect API; optional BrandingSet / custom labels via Tooling API"
134
133
  gating:
135
134
  irreversible: false
136
135
  note: "Reversible by disabling the deployment (isEnabled=false). Pre-chat form fields can be deactivated but the form cannot be fully deleted."
137
136
  validate:
138
137
  check: check-messaging-deployment
139
- passWhen: "GET EmbeddedServiceConfig fullName=<derived API name> returns isEnabled=true and the embeddedServiceMessagingChannel links values.channelName; published is true after an auto-published Web create (isPublishSuccess=true) and false for updates, which stay draft until the admin publishes"
138
+ passWhen: "GET EmbeddedServiceConfig fullName=<derived API name> returns isEnabled=true and the embeddedServiceMessagingChannel links the channel named in the intent; published is true after an auto-published Web create (isPublishSuccess=true) and false for updates, which stay draft until the admin publishes"
140
139
  alternative: "Setup > Embedded Service Deployments > New Deployment > Messaging for In-App and Web; choose the channel, set pre-chat, then Publish."
141
140
  ```
142
141
 
@@ -191,7 +191,7 @@ Consequences for this skill:
191
191
  1. **The ChoiceList must already exist in the target org**, created via the Dropdown dialog above. It is not part of the artifact this skill produces.
192
192
  2. In the form field, set `formFieldType` to `ChoiceList` and add a `<choiceList>` element with the existing record's DeveloperName (= the Dropdown API Name).
193
193
  3. The same field must also satisfy the **field ↔ channel coupling**: its `formField` must match an existing channel `customParameter` (the Channel Variable Name), and `messagingChannelParameterType` is `Custom`. Its channel param is `String`, like any custom field.
194
- 4. Before generating, confirm the ChoiceList exists. ChoiceList can't be queried through the data API or Tooling API, so don't run a query for it. Ask the user to confirm the dropdown exists in the Setup pre-chat editor (New Custom Field → Dropdown) and to give you its **Dropdown API Name**. If it doesn't exist **or the user isn't sure**, treat it as missing: leave the ChoiceList field out of every deploy (never deploy it to find out) and tell the user to create it in Setup first; do **not** attempt to generate or deploy a ChoiceList file. Give them a full, clickable link to the deployment's pre-chat editor: `<instanceUrl>/lightning/setup/EmbeddedServiceDeployments/<EmbeddedServiceConfigId>/EmbeddedMessaging/prechat`, where `instanceUrl` comes from `sf org display` and the Id from Tooling `SELECT Id FROM EmbeddedServiceConfig WHERE DeveloperName='<name>'`. Hand back only this plain URL; the user's own browser login opens it. Never paste `sf org open --url-only` output, because its frontdoor URL carries a login token. There they choose New Custom Field → Field Type `Dropdown`.
194
+ 4. Before generating, confirm the ChoiceList exists. ChoiceList can't be queried through the data API or Tooling API, so don't run a query for it. Ask the user to confirm the dropdown exists in the Setup pre-chat editor (New Custom Field → Dropdown) and to give you its **Dropdown API Name**. If it doesn't exist **or the user isn't sure**, treat it as missing: leave the ChoiceList field out of every deploy (never deploy it to find out) and tell the user to create it in Setup first; do **not** attempt to generate or deploy a ChoiceList file. Give them a full, clickable link to the deployment's pre-chat editor: `<instanceUrl>/lightning/setup/EmbeddedServiceDeployments/<EmbeddedServiceConfigId>/EmbeddedMessaging/prechat`, where `instanceUrl` comes from `sf org display --target-org '<org-alias>' --json | jq -r .result.instanceUrl` (always pipe through `jq`; the raw output contains the access token) and the Id from Tooling `SELECT Id FROM EmbeddedServiceConfig WHERE DeveloperName='<name>'`. Hand back only this plain URL; the user's own browser login opens it. Never paste `sf org open --url-only` output, because its frontdoor URL carries a login token. There they choose New Custom Field → Field Type `Dropdown`.
195
195
 
196
196
  ```xml
197
197
  <embeddedServiceFormFields>
@@ -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: