@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
@@ -16,24 +16,38 @@ metadata:
16
16
  semver: ">=2.0.0"
17
17
  - tool: ["python3"]
18
18
  semver: ">=3.8"
19
+ - tool: ["jq"]
20
+ semver: ">=1.7.0"
19
21
  ---
20
22
 
21
23
  # Configuring Enhanced Chat Channel
22
24
 
23
25
  Creates `MessagingChannel` metadata XML for Salesforce Messaging for In-App and Web (MIAW). This skill produces a fully configured enhanced chat channel with routing, user verification, pre-chat, and automated response settings ready for Metadata API deployment.
24
26
 
27
+ ## How delegation is handled
28
+
29
+ ### Service-Onboarding delegation
30
+
31
+ When `delegationFrom` is set to service-onboarding, fetch and follow
32
+ [the Service-Onboarding delegation guidelines](references/_vendored/service-onboarding-delegation-guidelines.md) before acting — it is the single
33
+ source of truth, identical across every service-onboarding delegate. When it is absent, ignore this
34
+ and run as a normal standalone conversation.
35
+
36
+ ---
37
+
25
38
  ## Scope
26
39
 
27
- - **In scope**: Creating `MessagingChannel` metadata with Omni-Channel Flow routing, Omni-Channel Queue routing, User routing, or Agentforce Service Agent (ASA) routing; enabling User Verification; configuring all channel settings (pre-chat forms, automated responses, consent keywords, file attachments, custom parameters)
40
+ - **In scope**: Creating `MessagingChannel` metadata with Omni-Channel Flow routing, Omni-Channel Queue routing, User routing, or Agentforce Service Agent (ASA) routing; enabling User Verification, including creating its keyset (`references/keyset_setup.md`); configuring all channel settings (pre-chat forms, automated responses, consent keywords, file attachments, custom parameters)
28
41
  - **Out of scope**: Creating the referenced Omni-Channel Flow/Queue definitions (use `automation-flow-generate`), creating the Embedded Service Deployment (separate metadata type — use `service-digital-engagement-deployment-configure`), creating permission sets for messaging (use `platform-permission-set-generate`), configuring the Embedded Service Code Snippet
29
42
 
30
43
  ---
31
44
 
32
45
  ## Entry points and transport
33
46
 
34
- - **Delegated** (`context.calledFrom == "service-onboarding"`): use the approved `values` and ask nothing for changes the plan row describes; confirm drift on an existing channel with the user (step 3a). Return `failed` naming any missing required key. **Standalone** (no `context`): ask for the Inputs below.
35
- - **Shell safety**: org alias and bot name must match `^[A-Za-z0-9_.@+-]+$` before use in a command; otherwise stop and ask (delegated: `failed`). Pass the channel label single-quoted, escaping any `'` as `'\''`.
36
- - **Transport A** (primary): headless-360 MCP `dispatch` / `dispatch_readonly` on `/headless/metadata`. **Transport B**: the `sf` commands below, only where a probe shows Transport A unavailable.
47
+ - **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. Never fabricate a value; a missing routing target, or invalid shell input, is `failed`. Announce writes without re-confirming each; confirm the target org (contract §2), drift on an existing channel (step 3a), and, with verification on but no keyset in `intent`, the keyset question (step 8). **Standalone** (no `delegationFrom`): ask for the Inputs below.
48
+ - **Shell safety**: org alias and bot name must match `^[A-Za-z0-9][A-Za-z0-9_.@+-]*$` before use in a command; otherwise stop and ask (delegated: `failed`). Pass the channel label single-quoted, escaping any `'` as `'\''`.
49
+ - **Transport A** (primary): headless-360 MCP `dispatch` / `dispatch_readonly` on `/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, load it (e.g. ToolSearch) and probe before choosing B; "not in my tool list" is not "unavailable". 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.
50
+ - **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.
37
51
 
38
52
  Details: `references/onboarding_contract.md` (§1 entry points, §2 transport, §3 pre-scan, §5 result).
39
53
 
@@ -41,13 +55,13 @@ Details: `references/onboarding_contract.md` (§1 entry points, §2 transport,
41
55
 
42
56
  ## Inputs
43
57
 
44
- Standalone: ask for anything not already clear. Delegated: take `values`.
58
+ Standalone: ask for anything not already clear. Delegated: take them from `intent`.
45
59
 
46
60
  - **Channel name**: `masterLabel` and file name (`<Name>.messagingChannel-meta.xml`)
47
61
  - **Routing type**: `Queue`, `Flow`, `User`, or `AgentforceServiceAgent`
48
62
  - **Routing target**: developer name of the queue, flow, user, or ASA bot
49
63
  - **Fallback queue** (Flow and ASA): developer name for escalation. **Routing config** (User): `QueueRoutingConfig` DeveloperName
50
- - **User verification**: JWT-based identity verification (default `false`, so `authMode` `UnAuth`). `true` makes an `Auth` channel; a keyset name is optional (with one, also an `authIdentifier`, a free-form label defaulting to the file name). Creating keys is a separate setup
64
+ - **User verification**: JWT-based identity verification (default `false`, so `authMode` `UnAuth`). `true` makes an `Auth` channel; a keyset name is optional (with one, also an `authIdentifier`, a free-form label defaulting to the file name). No keyset: creating one is `references/keyset_setup.md`
51
65
  - **Pre-chat fields** (optional): which fields and types
52
66
 
53
67
  Apply every other default from `references/channel_settings.md` unless the user specifies otherwise.
@@ -60,15 +74,15 @@ Run in order; step 3a may jump to step 15 or Phase 4. All SOQL below: Transport
60
74
 
61
75
  ### Phase 1 — Gather Context
62
76
 
63
- 1. **Verify org API version** — run `scripts/check-api-version.sh 67.0 '<org-alias>'` (skip it when Transport A is in use). Exit 1 = org below 67.0: stop and relay the script's next step (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 output folder only if none exists, with `sourceApiVersion` set to the script's `ORG_API_VERSION` (67.0 if exit 2).
77
+ 1. **Verify org API version** — run `scripts/check-api-version.sh 67.0 '<org-alias>'` (skip it when Transport A is in use). Exit 1 = org below 67.0: stop and relay the script's next step (delegated: `failed`). 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 output folder only if none exists, with `sourceApiVersion` set to the script's `ORG_API_VERSION` (67.0 if exit 2).
64
78
 
65
- 2. **Collect inputs** — standalone: ask for the Inputs. Delegated: from `values`. Then probe transport with a read-only `GET` of `MessagingChannel` (contract §2).
79
+ 2. **Collect inputs** — standalone: ask for the Inputs. Delegated: from `intent`. Then probe transport with a read-only `GET` of `MessagingChannel` (contract §2).
66
80
 
67
81
  3. **Determine file name** — run `scripts/normalize-channel-name.sh '<LABEL>'` and surface any errors it returns.
68
82
 
69
- 3a. **Pre-scan** — `GET` `MessagingChannel` by the step 3 name (contract §3): none → create; matches and active → no write, `already-configured`, skip to Phase 4; matches but inactive → activate only (step 15); differs → announce each change, then write the full document. Standalone: ask first and end your turn; no record update or deploy until the user continues. Delegated: confirm the drift with the user first (contract §3). This applies to any change to an existing channel, however small, and naming the exact change in the request is not consent. If `sessionHandlerType` changes, also follow `references/routing_transitions.md`.
83
+ 3a. **Pre-scan** — `GET` `MessagingChannel` by the step 3 name (contract §3): none → create; matches and active → no write, `already-configured`, skip to Phase 4; matches but inactive → activate only (step 15); differs → announce each change, then write the full document. Standalone: ask first and end your turn; no record update or deploy until the user continues. Delegated: confirm the drift with the user first (contract §3). This applies to any change to an existing channel, however small, and naming the exact change in the request is not consent. The one exception is the step 8 keyset question, which covers the follow-up update of a channel this run just created. If `sessionHandlerType` changes, also follow `references/routing_transitions.md`.
70
84
 
71
- 4. **Verify routing target exists** — skip when step 3a ended in `already-configured` or activate-only, so a re-run never creates a queue. Names must match `^[A-Za-z0-9_.@+-]+$` before they go into a query. Confirm the routing target exists with the lookup in `references/routing_transitions.md` → Target lookups (also the fallback queue for Flow and ASA, and the routing config for User).
85
+ 4. **Verify routing target exists** — skip when step 3a ended in `already-configured` or activate-only, so a re-run never creates a queue. Names must match `^[A-Za-z0-9][A-Za-z0-9_.@+-]*$` before they go into a query. Confirm the routing target exists with the lookup in `references/routing_transitions.md` → Target lookups (also the fallback queue for Flow and ASA, and the routing config for User). User routing: query the org for the username before writing any file (for "the active System Administrator", `SELECT Username FROM User WHERE Profile.Name='System Administrator' AND IsActive=true`); never write a placeholder or example username, and never assume no org is connected without running the query.
72
86
 
73
87
  If a target is not found, never write its metadata here. Delegated — return `failed` naming the missing target. Standalone — tell the user which target is missing and ask whether to create it. A queue or routing config: on yes, hand off to the owning skill in Cross-Skill Integration with an explicit name, then resume at step 4; on no, stop. If that skill is unavailable or returns `blocked`, stop and tell the user what to create — never write the queue or routing config yourself. A flow, user or bot has no owning skill here: stop and tell the user to create it. **A new queue needs a `QueueRoutingConfig`, or sessions fail with "Agents are not available. Try again later" even though the channel deploys and activates.**
74
88
 
@@ -76,7 +90,7 @@ Run in order; step 3a may jump to step 15 or Phase 4. All SOQL below: Transport
76
90
 
77
91
  ### Phase 2 — Generate Metadata
78
92
 
79
- 6. **Read the metadata template** — new channel: load `assets/messaging_channel_template.xml` as the starting structure. Existing channel (3a): start from its current document (Transport A `GET` `xmlRep`; Transport B `sf project retrieve start -m MessagingChannel:<Name>`) and change only the targeted elements, so pre-chat, responses, and authorizations survive.
93
+ 6. **Read the metadata template** — new channel: load `assets/messaging_channel_template.xml` as the starting structure and fill every unset value from `references/channel_settings.md` defaults, never from `examples/`. Existing channel (3a): start from its current document (Transport A `GET` `xmlRep`; Transport B `sf project retrieve start -m MessagingChannel:<Name>`) and change only the targeted elements, so pre-chat, responses, and authorizations survive.
80
94
 
81
95
  7. **Apply routing configuration** — set `sessionHandlerType` and the corresponding handler field:
82
96
 
@@ -85,11 +99,11 @@ Run in order; step 3a may jump to step 15 or Phase 4. All SOQL below: Transport
85
99
  | Omni-Channel Queue | `Queue` | `sessionHandlerQueue` |
86
100
  | Omni-Channel Flow | `Flow` | `sessionHandlerFlow` + `sessionHandlerQueue` (fallback) |
87
101
  | User | `User` | `sessionHandlerUser` (username) + `queueRoutingConfig`; no `sessionHandlerQueue` |
88
- | Agentforce Service Agent | `AgentforceServiceAgent` | `sessionHandlerQueue` (fallback) + `sessionHandlerAsa` (bot dev name — required, see v67 note below) |
102
+ | Agentforce Service Agent | `AgentforceServiceAgent` | `sessionHandlerQueue` (fallback) + `sessionHandlerAsa` (bot dev name — required) |
89
103
 
90
104
  For ASA, `<sessionHandlerAsa>` is required and the bot must be Active; see `references/routing_transitions.md` → Agentforce Service Agent.
91
105
 
92
- 8. **Apply user verification** — not enabled: set `embeddedConfig.authMode` to `UnAuth` and omit `<messagingAuthorizations>`. Enabled: follow `references/user_verification.md` (add `<messagingAuthorizations>` only for a keyset name the user gave; never invent one, and without one still write `Auth`).
106
+ 8. **Apply user verification** — not enabled: set `embeddedConfig.authMode` to `UnAuth` and omit `<messagingAuthorizations>`. Enabled: follow `references/user_verification.md` (add `<messagingAuthorizations>` only for a keyset name the user gave, or one just created or chosen; never invent one, and without one still write `Auth`). No keyset named (standalone, or delegated with verification on): do not block. Create and activate the channel as `Auth` without `<messagingAuthorizations>`, then ask right after step 15, before step 16: create a new keyset, use an existing one, or skip. Handle the answer per `references/keyset_setup.md` → After the channel exists. This is step 15b and is mandatory.
93
107
 
94
108
  9. **Configure embedded settings** — populate `<embeddedConfig>` per `references/channel_settings.md`: `anonymousUserJwtExpirationTime` for UnAuth, `verifiedUserJwtExpirationTime` for Auth.
95
109
 
@@ -111,18 +125,18 @@ Run in order; step 3a may jump to step 15 or Phase 4. All SOQL below: Transport
111
125
 
112
126
  14. **Write the channel** — if 3a found a routing-type change, first run `references/routing_transitions.md` Procedure steps 1–3; if the write fails, run its step 4 restore. Transport A: `POST` to create, `PUT` the **full** document to update (a minimal PUT drops `embeddedConfig`); check `results[].success`, then re-`GET`. Transport B:
113
127
  ```bash
114
- sf project deploy start --source-dir <path-to-messagingChannels-folder> --target-org <org-alias>
128
+ sf project deploy start --source-dir <path-to-messagingChannels-folder> --target-org '<org-alias>'
115
129
  ```
116
130
 
117
- 15. **Activate the channel** — after a successful write, activate the messaging channel (`IsActive` is not part of the metadata). Transport A: sObject update `{"IsActive": true}` through `dispatch`. Transport B:
131
+ 15. **Activate the channel** — after a successful write, activate the messaging channel (`IsActive` is not part of the metadata). Transport A: sObject update `{"IsActive": true}` through `dispatch`, with the Id from `SELECT Id FROM MessagingChannel WHERE DeveloperName='<CHANNEL_NAME>'` (keep it for step 18). Transport B:
118
132
  ```bash
119
- sf data update record --sobject MessagingChannel --where "DeveloperName='<CHANNEL_NAME>'" --values "IsActive=true" --target-org <org-alias>
133
+ sf data update record --sobject MessagingChannel --where "DeveloperName='<CHANNEL_NAME>'" --values "IsActive=true" --target-org '<org-alias>'
120
134
  ```
121
135
 
122
- 15a. **ASA routing only — verify the bind landed** (skip for Queue, Flow, User):
136
+ 15a. **ASA routing only — verify the bind landed** (skip for Queue, Flow, User). Transport A: run the query below through `dispatch_readonly`. Transport B:
123
137
 
124
138
  ```bash
125
- sf data query -o <org> --json \
139
+ sf data query -o '<org>' --json \
126
140
  -q "SELECT SessionHandlerId, FallbackQueueId FROM MessagingChannel WHERE DeveloperName='<CHANNEL_DEV_NAME>'"
127
141
  ```
128
142
 
@@ -130,11 +144,18 @@ Run in order; step 3a may jump to step 15 or Phase 4. All SOQL below: Transport
130
144
 
131
145
  ### Phase 4 — Validate
132
146
 
147
+ 15b. **Keyset question — REQUIRED for every `Auth` channel with no keyset** (verification on, no keyset in the input, none just created). Do not go to step 16 or report until this is asked and answered; a note in the final summary does not replace it. Ask one question with exactly these options, then handle the answer per `references/keyset_setup.md` → After the channel exists:
148
+ - **Create a new keyset** — from JWKS keys or an endpoint URL, then attach it to the channel.
149
+ - **Use an existing keyset** — list the org's `PublicKeyCertificateSet` records, user picks, then attach it.
150
+ - **Skip** — change nothing; tell the user verification is not active until a keyset is attached.
151
+
152
+ Delegated: ask it too (relay it to the user through the caller per the delegation guidelines), then set `keysetChoice` per the contract and report `verificationActive` accordingly in the §5 result. Skip this step when a keyset was supplied or this is an `UnAuth` channel.
153
+
133
154
  16. **Verify against checklist** — confirm all items in the Verification Checklist below pass before presenting output.
134
155
 
135
156
  17. **Report** — delegated: return the contract §5 result and stop. Standalone: continue.
136
157
 
137
- 18. **Present output** (standalone) — in a few lines: confirm the channel is created and its activation status, and list each setting the user asked for with its final value, whatever field it is. Say everything else uses the defaults, without listing them. Give transport details, file paths and record Ids only after a failure or if asked. Then offer next steps:
158
+ 18. **Present output** (standalone) — for an `Auth` channel with no keyset, only after step 15b is answered; state the choice made (including "skipped: verification not active until a keyset is attached"). In a few lines: confirm the channel is created and its activation status, and list each setting the user asked for with its final value, whatever field it is. Say everything else uses the defaults, without listing them. Give transport details, file paths and record Ids only after a failure or if asked, except the channel's Setup review link, always given as built in `references/onboarding_contract.md` §2 (Id from step 15; path alone when `instanceUrl` is unknown). Never guess a Setup path. Then offer next steps:
138
159
  - **Automated responses** — ask which messages the user wants using the Setup labels per `references/channel_settings.md` → "Setup Prompts: Automated Responses", then redeploy.
139
160
  - **reCAPTCHA** — not settable by this skill; say this skill does not set or check it and offer the admin handoff in `references/recaptcha_handoff.md`.
140
161
 
@@ -146,14 +167,11 @@ Run in order; step 3a may jump to step 15 or Phase 4. All SOQL below: Transport
146
167
  |-----------|-----------|
147
168
  | File name serves as the channel API name | No `channelPlatformKey` field in the XML body |
148
169
  | `sessionHandlerType` must match the handler fields present | Setting `Queue` but populating `sessionHandlerFlow` causes deployment error |
149
- | Flow routing requires both `sessionHandlerFlow` and `sessionHandlerQueue` | Queue is the mandatory fallback for human escalation |
150
- | User routing requires `sessionHandlerUser` and `queueRoutingConfig`, and no `sessionHandlerQueue` | The platform rejects a fallback queue on User routing |
151
170
  | `masterLabel` max 40 characters | Platform limit on channel labels |
152
171
  | File name must match `^[a-zA-Z][a-zA-Z0-9_]*$` | API name format enforced by Metadata API |
153
172
  | `allowedFileTypes` is a comma-separated string with no spaces | Not a nested list or array |
154
173
  | `keyword` elements are individual — one per trigger word | Not a comma-separated list |
155
174
  | `customParameters` need `name`, `masterLabel`, `parameterDataType`, and `externalParameterName` | Incomplete parameters fail silently |
156
- | File extension is `.messagingChannel-meta.xml` | Metadata API uses this specific extension |
157
175
  | Do not hardcode file paths — respect `sfdx-project.json` package directories | Customer orgs customize source paths |
158
176
  | Channel must be activated after deployment | Channels are inactive by default — messages won't route until activated |
159
177
  | `isSynchronousChatEnabled` defaults to `false`; can only be `true` for UnAuth channels upon user request | Platform rejects "You can't enable Session-Based Chat for verified users" for Auth channels |
@@ -165,19 +183,13 @@ Run in order; step 3a may jump to step 15 or Phase 4. All SOQL below: Transport
165
183
  | Issue | Resolution |
166
184
  |-------|------------|
167
185
  | Routing-type change fails with a fallback-queue or "Only a Queue or Flow Routing Method…" error | The old type's fields are still set; see `references/routing_transitions.md` |
168
- | Channel name conflicts with existing channel | Check org for existing channels; file name must be unique |
169
- | Queue not found on deploy | Ensure the referenced queue exists and has `MessagingSession` as a `queueSobject` type |
170
186
  | Channel deploys and activates fine, but widget shows "Agents are not available. Try again later." at session start | The queue has no `QueueRoutingConfig` — this is silent at deploy time. Check `SELECT QueueRoutingConfigId FROM Group WHERE Id='<QUEUE_ID>'`; if null, create one with `service-omni-queue-routing-config-deploy` |
171
- | Omni-Channel Flow not found on deploy | Ensure the referenced flow exists and is active before deploying the channel |
172
- | ASA bot reference invalid | Bot must be published and active; use exact developer name from BotDefinition metadata |
173
- | ASA channel deployed but `SessionHandlerId` is null after deploy | Bot was not Active at deploy time — run `sf agent activate`, confirm `BotVersion.Status = Active`, then redeploy |
187
+ | ASA bot reference invalid, or `SessionHandlerId` null after deploy | The bot must be published and Active (exact developer name from BotDefinition) before the deploy. Run `sf agent activate`, confirm `BotVersion.Status = Active`, then redeploy |
174
188
  | JWT verification not working | The keyset (`PublicKeyCertificateSet`) named in `messagingAuthorizations` must exist in the org and match the token's `kid` and issuer |
175
189
  | Custom parameters not collected | `name` must be unique per channel |
176
190
  | `<customParameters>` deploy fails: "bad value for restricted picklist field" | `parameterDataType` was set to something other than `String`. Channel custom parameters are always `String`; set the field's actual type (Number, Checkbox, dropdown) at the deployment level, not here |
177
191
  | Removing a custom parameter: "can't be deleted as it is referenced elsewhere" | **Check before deploying, not after.** Every deployment on this channel whose pre-chat form uses the param must first drop that field and be published (user-approved); remove the param's `actionParameterMappings` in a separate deploy first. See `references/channel_settings.md` §Removing a Custom Parameter |
178
192
  | Automated response / session-inactivity deploy fails | See `references/channel_settings.md` → "Automated Responses", "Session Settings" |
179
- | Channel deployed but messages not routing | Channel must be activated after deployment — it defaults to inactive |
180
- | "You can't enable Session-Based Chat for verified users" | Set `isSynchronousChatEnabled` to `false` for Auth channels — session-based chat is only valid for UnAuth |
181
193
 
182
194
  ---
183
195
 
@@ -191,14 +203,14 @@ Run in order; step 3a may jump to step 15 or Phase 4. All SOQL below: Transport
191
203
  - [ ] Session inactivity / automated responses (only if requested) checked against `references/channel_settings.md`?
192
204
 
193
205
  ### Routing Checks
194
- - [ ] Exactly one `sessionHandlerType` value is set (`Queue`, `Flow`, `User`, or `AgentforceServiceAgent`)?
195
- - [ ] Queue: `sessionHandlerQueue` in the XML? Flow: `sessionHandlerFlow` plus `sessionHandlerQueue` as fallback? User: `sessionHandlerUser` plus `queueRoutingConfig`, no `sessionHandlerQueue`? ASA: both `sessionHandlerQueue` and `sessionHandlerAsa`?
206
+ - [ ] Exactly one `sessionHandlerType` is set, with the handler fields from the step 7 table and no others?
196
207
  - [ ] ASA: step 15a run, with `SessionHandlerId` and `FallbackQueueId` non-null after the deploy?
197
208
  - [ ] The routing target references an existing entity in the org?
198
209
 
199
210
  ### Activation Checks
200
211
  - [ ] Was the channel deployed successfully?
201
212
  - [ ] Was the channel activated after deployment (`IsActive=true`)?
213
+ - [ ] `Auth` channel with no keyset: was the step 15b keyset question (create / use existing / skip) asked and answered before this checklist, and is the answer reflected in the report?
202
214
 
203
215
  ---
204
216
 
@@ -219,11 +231,12 @@ Run in order; step 3a may jump to step 15 or Phase 4. All SOQL below: Transport
219
231
 
220
232
  | File | When to read |
221
233
  |------|-------------|
222
- | `references/onboarding_contract.md` | Delegated mode (`context.calledFrom == "service-onboarding"`), org writes (transport), module registration |
234
+ | `references/onboarding_contract.md` | Delegated mode (`delegationFrom` set), org writes (transport), module registration |
223
235
  | `assets/messaging_channel_template.xml` | Before generating — use as the starting structure |
224
236
  | `references/channel_settings.md` | When configuring channel options beyond defaults |
225
237
  | `references/routing_transitions.md` | Changing a channel's routing type, or looking up routing targets |
226
238
  | `references/user_verification.md` | The user turns user verification (Auth mode) on |
239
+ | `references/keyset_setup.md` | The user needs to create a verification keyset (JWKS keys or endpoint URL); also `keyset_settings.md`, `user_verification_client.md` |
227
240
  | `references/prechat_params.md` | The user needs standard or custom pre-chat parameters |
228
241
  | `references/recaptcha_handoff.md` | The user asks about reCAPTCHA / captcha, or at the end of standalone output |
229
242
  | `scripts/check-api-version.sh` | Phase 1 — verify org API version meets the passed minimum (67.0) |
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ PublicKeyCertificateSet — JWKS (uploaded keys) mode.
4
+ Groups one or more PublicKeyCertificate components under a JWT issuer.
5
+ Deploy the referenced PublicKeyCertificate components BEFORE this set.
6
+
7
+ jwtIssuer: must match the JWT `iss` claim exactly. StringOrURI (RFC 7519): a bare
8
+ string with no colon (e.g. testIssuer) is valid and deploys fine; only a value
9
+ containing a `:` must be a well-formed URI.
10
+ Repeat <publicKeyCertificateSetKeys> once per key; <publicKeyCertificate> is the
11
+ key's API name (the PublicKeyCertificate fullName).
12
+ -->
13
+ <PublicKeyCertificateSet xmlns="http://soap.sforce.com/2006/04/metadata">
14
+ <jwtIssuer>{JWT_ISSUER}</jwtIssuer>
15
+ <masterLabel>{KEYSET_LABEL}</masterLabel>
16
+ <publicKeyCertificateSetKeys>
17
+ <publicKeyCertificate>{KEY_API_NAME}</publicKeyCertificate>
18
+ </publicKeyCertificateSetKeys>
19
+ <type>JWKS</type>
20
+ </PublicKeyCertificateSet>
@@ -0,0 +1,23 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ PublicKeyCertificateSet — JWKS_URL (endpoint) mode.
4
+ No PublicKeyCertificate components are created; Salesforce fetches keys from the
5
+ endpoint. Preferred for many users / rotating IdP keys.
6
+
7
+ jwtIssuer: matches the JWT `iss` claim exactly (StringOrURI — a bare string is
8
+ valid; only a colon-bearing value must be a well-formed URI). For JWKS_URL the
9
+ issuer is conventionally the IdP's https:// URL, but that's convention, not a rule.
10
+ The endpoint must be hosted OUTSIDE Salesforce and serve RS256/RS512 keys.
11
+
12
+ Endpoint element name `jwksEndPoint` is confirmed against the Metadata API
13
+ type definition for PublicKeyCertificateSet: "JWKS_URL — Used to specify a
14
+ certificate via the jwksEndPoint field on this Type" (core model getter
15
+ getJwksEndPoint()). Required when type=JWKS_URL; the platform rejects a
16
+ JWKS_URL set with a null/invalid jwksEndPoint.
17
+ -->
18
+ <PublicKeyCertificateSet xmlns="http://soap.sforce.com/2006/04/metadata">
19
+ <jwtIssuer>{JWT_ISSUER}</jwtIssuer>
20
+ <jwksEndPoint>{JWKS_ENDPOINT_URL}</jwksEndPoint>
21
+ <masterLabel>{KEYSET_LABEL}</masterLabel>
22
+ <type>JWKS_URL</type>
23
+ </PublicKeyCertificateSet>
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ PublicKeyCertificate — one per uploaded key (JWKS / uploaded-keys mode only).
4
+ Not used in JWKS_URL (endpoint) mode.
5
+
6
+ jsonWebKey: the customer's PUBLIC JWK as a single JSON object, XML-escaped
7
+ (& -> &amp; " -> &quot; < -> &lt; > -> &gt;). It must be a public key:
8
+ kty, kid, alg (RS256|RS512), use=sig, n, e, and optionally x5c. It must NOT
9
+ contain a real private exponent (d).
10
+ -->
11
+ <PublicKeyCertificate xmlns="http://soap.sforce.com/2006/04/metadata">
12
+ <isActive>true</isActive>
13
+ <jsonWebKey>{XML_ESCAPED_PUBLIC_JWK_JSON}</jsonWebKey>
14
+ <masterLabel>{KEY_LABEL}</masterLabel>
15
+ </PublicKeyCertificate>
@@ -22,7 +22,7 @@
22
22
  <isEstimatedWaitTimeEnabled>false</isEstimatedWaitTimeEnabled>
23
23
  <isFallbackMessageEnabled>false</isFallbackMessageEnabled>
24
24
  <isFileAttachmentExtUnrestricted>false</isFileAttachmentExtUnrestricted>
25
- <isSaveTranscriptEnabled>true</isSaveTranscriptEnabled>
25
+ <isSaveTranscriptEnabled>false</isSaveTranscriptEnabled>
26
26
  <maxFileSize>5</maxFileSize>
27
27
  </embeddedConfig>
28
28
  <endUserIdleTimeOut>5</endUserIdleTimeOut>
@@ -19,10 +19,10 @@
19
19
  <chatAbandonmentTimeout>5</chatAbandonmentTimeout>
20
20
  <isAbandonedChatsEnabled>true</isAbandonedChatsEnabled>
21
21
  <isAttachmentUploadEnabled>true</isAttachmentUploadEnabled>
22
- <isEstimatedWaitTimeEnabled>true</isEstimatedWaitTimeEnabled>
22
+ <isEstimatedWaitTimeEnabled>false</isEstimatedWaitTimeEnabled>
23
23
  <isFallbackMessageEnabled>false</isFallbackMessageEnabled>
24
24
  <isFileAttachmentExtUnrestricted>false</isFileAttachmentExtUnrestricted>
25
- <isSaveTranscriptEnabled>true</isSaveTranscriptEnabled>
25
+ <isSaveTranscriptEnabled>false</isSaveTranscriptEnabled>
26
26
  <maxFileSize>5</maxFileSize>
27
27
  <messagingAuthorizations>
28
28
  <authIdentifier>Customer_Support_Chat</authIdentifier>
@@ -32,7 +32,7 @@
32
32
  </messagingAuthorizations>
33
33
  </embeddedConfig>
34
34
  <endUserIdleTimeOut>5</endUserIdleTimeOut>
35
- <isEstimatedWaitTimeEnabled>true</isEstimatedWaitTimeEnabled>
35
+ <isEstimatedWaitTimeEnabled>false</isEstimatedWaitTimeEnabled>
36
36
  <isQueuePositionEnabled>false</isQueuePositionEnabled>
37
37
  <isSynchronousChatEnabled>false</isSynchronousChatEnabled>
38
38
  <isVoiceModeEnabled>false</isVoiceModeEnabled>
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ Example — JWKS (uploaded keys) mode, the key. One PublicKeyCertificate per key.
4
+ File: PublicKeyCertificate/AuthKey.PublicKeyCertificate-meta.xml
5
+ Deploy the key(s) BEFORE the set in jwks_upload_keyset.xml.
6
+ -->
7
+ <PublicKeyCertificate xmlns="http://soap.sforce.com/2006/04/metadata">
8
+ <isActive>true</isActive>
9
+ <jsonWebKey>{&quot;kty&quot;:&quot;RSA&quot;,&quot;e&quot;:&quot;AQAB&quot;,&quot;use&quot;:&quot;sig&quot;,&quot;kid&quot;:&quot;12345&quot;,&quot;alg&quot;:&quot;RS256&quot;,&quot;n&quot;:&quot;BASE64URL_RSA_MODULUS&quot;}</jsonWebKey>
10
+ <masterLabel>AuthKey</masterLabel>
11
+ </PublicKeyCertificate>
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ Example — JWKS (uploaded keys) mode, the set that references the key in jwks_upload_key.xml.
4
+ File: PublicKeyCertificateSet/AuthKeySet.PublicKeyCertificateSet-meta.xml
5
+ -->
6
+ <PublicKeyCertificateSet xmlns="http://soap.sforce.com/2006/04/metadata">
7
+ <jwtIssuer>https://auth.example.com/issuer</jwtIssuer>
8
+ <masterLabel>AuthKeySet</masterLabel>
9
+ <publicKeyCertificateSetKeys>
10
+ <publicKeyCertificate>AuthKey</publicKeyCertificate>
11
+ </publicKeyCertificateSetKeys>
12
+ <type>JWKS</type>
13
+ </PublicKeyCertificateSet>
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!--
3
+ Example — JWKS_URL (endpoint) mode. Single PublicKeyCertificateSet; no key files.
4
+ Salesforce fetches keys from the endpoint (must be hosted outside Salesforce,
5
+ serving RS256/RS512 keys). Preferred for many users / rotating IdP keys.
6
+
7
+ The <jwksEndPoint> element name is confirmed against the Metadata API type
8
+ definition for PublicKeyCertificateSet (core getter getJwksEndPoint()).
9
+
10
+ File: PublicKeyCertificateSet/IdpKeyset.PublicKeyCertificateSet-meta.xml
11
+ -->
12
+ <PublicKeyCertificateSet xmlns="http://soap.sforce.com/2006/04/metadata">
13
+ <jwtIssuer>https://login.example.com/oauth2/v2.0</jwtIssuer>
14
+ <jwksEndPoint>https://login.example.com/discovery/v2.0/keys</jwksEndPoint>
15
+ <masterLabel>IdpKeyset</masterLabel>
16
+ <type>JWKS_URL</type>
17
+ </PublicKeyCertificateSet>
@@ -33,14 +33,14 @@
33
33
  <chatAbandonmentTimeout>10</chatAbandonmentTimeout>
34
34
  <isAbandonedChatsEnabled>true</isAbandonedChatsEnabled>
35
35
  <isAttachmentUploadEnabled>true</isAttachmentUploadEnabled>
36
- <isEstimatedWaitTimeEnabled>true</isEstimatedWaitTimeEnabled>
36
+ <isEstimatedWaitTimeEnabled>false</isEstimatedWaitTimeEnabled>
37
37
  <isFallbackMessageEnabled>false</isFallbackMessageEnabled>
38
38
  <isFileAttachmentExtUnrestricted>false</isFileAttachmentExtUnrestricted>
39
- <isSaveTranscriptEnabled>true</isSaveTranscriptEnabled>
39
+ <isSaveTranscriptEnabled>false</isSaveTranscriptEnabled>
40
40
  <maxFileSize>5</maxFileSize>
41
41
  </embeddedConfig>
42
42
  <endUserIdleTimeOut>10</endUserIdleTimeOut>
43
- <isEstimatedWaitTimeEnabled>true</isEstimatedWaitTimeEnabled>
43
+ <isEstimatedWaitTimeEnabled>false</isEstimatedWaitTimeEnabled>
44
44
  <isQueuePositionEnabled>false</isQueuePositionEnabled>
45
45
  <isSynchronousChatEnabled>false</isSynchronousChatEnabled>
46
46
  <isVoiceModeEnabled>false</isVoiceModeEnabled>
@@ -19,14 +19,14 @@
19
19
  <chatAbandonmentTimeout>5</chatAbandonmentTimeout>
20
20
  <isAbandonedChatsEnabled>true</isAbandonedChatsEnabled>
21
21
  <isAttachmentUploadEnabled>true</isAttachmentUploadEnabled>
22
- <isEstimatedWaitTimeEnabled>true</isEstimatedWaitTimeEnabled>
22
+ <isEstimatedWaitTimeEnabled>false</isEstimatedWaitTimeEnabled>
23
23
  <isFallbackMessageEnabled>false</isFallbackMessageEnabled>
24
24
  <isFileAttachmentExtUnrestricted>false</isFileAttachmentExtUnrestricted>
25
- <isSaveTranscriptEnabled>true</isSaveTranscriptEnabled>
25
+ <isSaveTranscriptEnabled>false</isSaveTranscriptEnabled>
26
26
  <maxFileSize>5</maxFileSize>
27
27
  </embeddedConfig>
28
28
  <endUserIdleTimeOut>5</endUserIdleTimeOut>
29
- <isEstimatedWaitTimeEnabled>true</isEstimatedWaitTimeEnabled>
29
+ <isEstimatedWaitTimeEnabled>false</isEstimatedWaitTimeEnabled>
30
30
  <isQueuePositionEnabled>false</isQueuePositionEnabled>
31
31
  <isSynchronousChatEnabled>false</isSynchronousChatEnabled>
32
32
  <isVoiceModeEnabled>false</isVoiceModeEnabled>
@@ -22,7 +22,7 @@
22
22
  <isEstimatedWaitTimeEnabled>false</isEstimatedWaitTimeEnabled>
23
23
  <isFallbackMessageEnabled>false</isFallbackMessageEnabled>
24
24
  <isFileAttachmentExtUnrestricted>false</isFileAttachmentExtUnrestricted>
25
- <isSaveTranscriptEnabled>true</isSaveTranscriptEnabled>
25
+ <isSaveTranscriptEnabled>false</isSaveTranscriptEnabled>
26
26
  <maxFileSize>5</maxFileSize>
27
27
  </embeddedConfig>
28
28
  <endUserIdleTimeOut>5</endUserIdleTimeOut>
@@ -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.
@@ -99,7 +99,7 @@ Comma-separated string, no spaces between extensions.
99
99
  When user verification is enabled:
100
100
  - Set `authMode` to `Auth`
101
101
  - The customer's backend must issue a signed JWT containing user identity claims
102
- - JWTs are verified only once a keyset (public key certificate set) whose key `kid` and issuer match them is attached via `messagingAuthorizations`; the channel itself deploys without one. Creating keys is a separate setup
102
+ - JWTs are verified only once a keyset (public key certificate set) whose key `kid` and issuer match them is attached via `messagingAuthorizations`; the channel itself deploys without one. Create keysets per `references/keyset_setup.md`
103
103
 
104
104
  ---
105
105
 
@@ -0,0 +1,46 @@
1
+ # Keyset Settings Reference
2
+
3
+ The org-side keyset for MIAW token-based user verification. Two metadata types. Templates: `assets/public_key_certificate*.xml`; examples: `examples/jwks_*.xml`.
4
+
5
+ ---
6
+
7
+ ## `PublicKeyCertificate` (JWKS / uploaded-keys mode only)
8
+
9
+ Dir `PublicKeyCertificate/`, suffix `.PublicKeyCertificate-meta.xml`.
10
+
11
+ | Field | Type | Required | Description |
12
+ |-------|------|----------|-------------|
13
+ | `masterLabel` | String | Yes | Display name of the key |
14
+ | `isActive` | Boolean | Yes | Whether the key is active |
15
+ | `jsonWebKey` | String (escaped JSON) | Yes | The PUBLIC JWK, one JSON object, XML-escaped |
16
+
17
+ `jsonWebKey` JSON fields (public JWK):
18
+
19
+ | Field | Notes |
20
+ |-------|-------|
21
+ | `kty` | `RSA` |
22
+ | `kid` | Key id — MUST match the JWT header `kid` |
23
+ | `alg` | `RS256` or `RS512` |
24
+ | `use` | `sig` |
25
+ | `n`, `e` | RSA public modulus / exponent (base64url) |
26
+ | `x5c` | Optional cert chain |
27
+
28
+ > Do NOT include a real private exponent (`d`). A public JWK for upload has `n`/`e`
29
+ > (and optionally `x5c`) only. On a live retrieve, private-only slots come back as
30
+ > placeholder literals (e.g. `"d":"d"`) — Salesforce stores only the public half.
31
+
32
+ ---
33
+
34
+ ## `PublicKeyCertificateSet`
35
+
36
+ Dir `PublicKeyCertificateSet/`, suffix `.PublicKeyCertificateSet-meta.xml` (casing is load-bearing).
37
+
38
+ | Field | Type | Required | Description |
39
+ |-------|------|----------|-------------|
40
+ | `masterLabel` | String | Yes | Display name of the keyset |
41
+ | `jwtIssuer` | StringOrURI | Yes | Matches the JWT `iss` claim exactly. Bare strings (no colon, e.g. `testIssuer`) are valid and deploy fine; only a value containing a `:` must be a well-formed URI (RFC 7519 StringOrURI) |
42
+ | `type` | Enum | Yes | `JWKS` (uploaded keys) or `JWKS_URL` (endpoint). All caps |
43
+ | `publicKeyCertificateSetKeys` | List | JWKS only | One entry per key; child `<publicKeyCertificate>` = the key's API name |
44
+ | `jwksEndPoint` | String (URL) | JWKS_URL only | JWKS endpoint hosted outside Salesforce. Required when `type=JWKS_URL` — a null/invalid endpoint is rejected on create/update |
45
+
46
+ `JWKS_URL` suits large or rotating key sets: Salesforce re-fetches keys from the endpoint, so no re-upload on rotation. The endpoint must be outside Salesforce and serve RS256/RS512 keys. A `JWKS_URL` set cannot hold keys.
@@ -0,0 +1,42 @@
1
+ # Keyset setup (creating the verification keyset)
2
+
3
+ Applies when user verification is on (step 8) and the user gives a key source, asks to create a keyset, or answers "create" to the question below. Delegated mode reaches it only when `verificationKeyset` is absent and the user answers "create"; a given `verificationKeyset` is used as is.
4
+
5
+ The keyset is what Salesforce uses to verify customer-signed JWTs. It is a `PublicKeyCertificateSet`, plus one `PublicKeyCertificate` per key in uploaded-keys mode. Fields: `references/keyset_settings.md`. Customer-side signing contract: `references/user_verification_client.md`.
6
+
7
+ ## Rules
8
+
9
+ - Public keys only. Never accept a private key or PEM (a JWK with a meaningful `d`); stop and ask for the public JWKS. A pasted public JWKS (only `n`, `e`, `kid` and similar public fields) is fine. If a private key was pasted in chat, stop and tell the user to treat that key as exposed and rotate it.
10
+ - Never `Read`/`cat` a customer's key file: a JWKS export can carry private fields. Extract only the public fields with a script (e.g. `jq`), and refuse the file if any key has a real `d`, `p`, `q`, `dp`, `dq` or `qi` (test without printing values). Ignore the placeholder literals an org retrieve returns (`"d":"d"`, `"y":"y"`, `"k":"k"`, `"crv":"crv"`) and drop them. Never echo `n`/`e` back beyond the generated file.
11
+ - Never generate keys. The private key lives on the customer's backend. Only if the user explicitly asks for throwaway test keys for a dev org, point them to the offline `key-command-line-utility` and say the material is disposable.
12
+ - Deploy each `PublicKeyCertificate` before the set that references it.
13
+ - `jwtIssuer` must equal the `iss` the customer's JWTs carry exactly; do not force a URI (field rules in `keyset_settings.md`).
14
+
15
+ ## Ask first
16
+
17
+ 1. Mode: uploaded keys (`type` `JWKS`) or endpoint URL (`type` `JWKS_URL`).
18
+ 2. Key source, the main input. Uploaded keys: the path to the customer's `jwks.json`, or pasted JWK/JWKS JSON. Extract `kid`, `alg`, `kty`, `use`, `n`, `e`, optional `x5c` from it as above; never ask the user to type them. Endpoint URL: the JWKS URL, hosted outside Salesforce. Use the keys URL, not the `.well-known/openid-configuration` URL.
19
+ 3. Keyset API name and label, and the JWT issuer.
20
+
21
+ ## Generate
22
+
23
+ Folder and suffix casing is load-bearing: `PublicKeyCertificate/` and `PublicKeyCertificateSet/` with `.PublicKeyCertificate-meta.xml` and `.PublicKeyCertificateSet-meta.xml`. Not `publicKeyCertificateSets/`; the CLI cannot infer the type.
24
+
25
+ - Uploaded keys: per JWK, `PublicKeyCertificate/<KeyName>.PublicKeyCertificate-meta.xml` from `assets/public_key_certificate_template.xml` (`isActive` `true`, `masterLabel`, `jsonWebKey` as the XML-escaped single-key JSON; default `<KeyName>` from the `kid`). Then `PublicKeyCertificateSet/<KeysetName>.PublicKeyCertificateSet-meta.xml` from `assets/public_key_certificate_set_jwks_template.xml`, one `publicKeyCertificateSetKeys` entry per key.
26
+ - Endpoint URL: only the set, from `assets/public_key_certificate_set_jwks_url_template.xml`, with `jwksEndPoint`. No key components; a `JWKS_URL` set cannot hold keys.
27
+
28
+ ## Deploy and verify
29
+
30
+ Use the transport rules in `references/onboarding_contract.md` §2: probe a read per type (`PublicKeyCertificate`, `PublicKeyCertificateSet`), use `/headless/metadata` where the probe allows it (POST create, PUT full `xmlRep` on re-run, built from the generated file), otherwise `sf project deploy start --metadata "PublicKeyCertificate:<KeyName>"` then `"PublicKeyCertificateSet:<KeysetName>"`. Read it back (GET, or `sf project retrieve start`) and confirm `jwtIssuer`, `type` and each key's `kid`.
31
+
32
+ ## Hand off to the channel
33
+
34
+ Use the keyset API name as `publicKeyCertificateSetName` in `references/user_verification.md`. Three values must line up at runtime: the JWT header `kid` is in the keyset's JWKS, the JWT `iss` equals `jwtIssuer`, and the channel's `publicKeyCertificateSetName` equals the keyset's API name. A `kid` already used by another key in the org fails the deploy, so before deploying retrieve the org's existing `PublicKeyCertificate` keys and compare their `kid`s with the new ones. On a match, reference the existing key in the new set instead of duplicating it.
35
+
36
+ ## After the channel exists
37
+
38
+ No keyset named (standalone, or delegated without `verificationKeyset`): the channel is already created and activated as `Auth` without `messagingAuthorizations`. Ask one question right after step 15 and before step 16: create a new keyset, use an existing one, or skip. The answer is consent for the follow-up update of the channel this skill just created, and sets `keysetChoice` in the delegated result.
39
+
40
+ - **Create**: run Ask first, Generate and Deploy above, then add `messagingAuthorizations` to the channel with a full-document update (step 14).
41
+ - **Use existing**: list the org's `PublicKeyCertificateSet` records (name, label, `type`, `jwtIssuer`) and let the user pick; never choose for them. Then add `messagingAuthorizations` the same way. No keyset files are written.
42
+ - **Skip**: change nothing and say verification is not active until a keyset is attached.