@salesforce/afv-skills 1.67.0 → 1.69.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.
- package/README.md +55 -5
- package/package.json +1 -1
- package/skills/afcc-setup-coordinate/SKILL.md +348 -0
- package/skills/afcc-setup-coordinate/assets/console-app/AFCC_Service_Console.app-meta.xml +19 -0
- package/skills/afcc-setup-coordinate/assets/console-app/Admin.profile-meta.xml +8 -0
- package/skills/afcc-setup-coordinate/assets/console-app/Standard.profile-meta.xml +8 -0
- package/skills/afcc-setup-coordinate/assets/gap_report_template.md +35 -0
- package/skills/afcc-setup-coordinate/assets/org_profile_template.json +16 -0
- package/skills/afcc-setup-coordinate/references/gotchas.md +22 -0
- package/skills/afcc-setup-coordinate/scripts/audit_org.sh +159 -0
- package/skills/agentforce-bot-upgrade/SKILL.md +117 -66
- package/skills/agentforce-bot-upgrade/assets/_vendored/agent-spec-template.md +139 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/agent-design-and-spec-creation.md +1211 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/agent-script-core-language.md +1390 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/agent-subagent-map-diagrams.md +341 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/agent-user-setup.md +672 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/agent-validation-and-debugging.md +904 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/agentscript-toolchain.md +112 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/architecture-patterns.md +277 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/common-control-flow-pitfalls.md +255 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/control-flow-actions-sequencing.md +198 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/control-flow-lifecycle-side-effects.md +87 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/data-library-reference.md +891 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/instruction-resolution.md +658 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/org-setup-for-adl.md +551 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/patterns-by-requirement.md +88 -0
- package/skills/agentforce-bot-upgrade/references/_vendored/posture-and-determinism.md +215 -0
- package/skills/agentforce-bot-upgrade/references/extraction-blueprint.md +11 -4
- package/skills/agentforce-bot-upgrade/references/generate-agent-spec.md +19 -3
- package/skills/agentforce-bot-upgrade/references/handoff-output-format.md +82 -52
- package/skills/agentforce-bot-upgrade/references/input-contract.md +8 -8
- package/skills/agentforce-bot-upgrade/references/mapping-rules.md +19 -6
- package/skills/agentforce-bot-upgrade/references/post-conversion-enhancements-reference.md +65 -6
- package/skills/agentforce-bot-upgrade/references/quality-checklist.md +4 -4
- package/skills/agentforce-bot-upgrade/references/sf-cli-bot-reference.md +17 -3
- package/skills/agentforce-hyperclassifier-configure/README.md +24 -0
- package/skills/agentforce-hyperclassifier-configure/SKILL.md +111 -0
- package/skills/agentforce-hyperclassifier-configure/assets/customer-org.env.example +4 -0
- package/skills/agentforce-hyperclassifier-configure/assets/sample_descriptions.json +8 -0
- package/skills/agentforce-hyperclassifier-configure/assets/sample_evals.csv +17 -0
- package/skills/agentforce-hyperclassifier-configure/references/api-contract.md +41 -0
- package/skills/agentforce-hyperclassifier-configure/references/authentication.md +35 -0
- package/skills/agentforce-hyperclassifier-configure/references/evaluation.md +46 -0
- package/skills/agentforce-hyperclassifier-configure/references/installation.md +35 -0
- package/skills/agentforce-hyperclassifier-configure/references/onboarding.md +93 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/__init__.py +1 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/client.py +219 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/eca.py +178 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/evaluation.py +207 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/onboarding.py +191 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/hcopt/optimizer.py +187 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/hyperclassifier.py +111 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/report_hyperclassifier.py +149 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/setup_hyperclassifier.py +74 -0
- package/skills/agentforce-hyperclassifier-configure/scripts/tests/test_hyperclassifier_skill.py +887 -0
- package/skills/agentforce-offline-experimentation-run/SKILL.md +14 -22
- package/skills/agentforce-offline-experimentation-run/scripts/bt_compare.py +81 -0
- package/skills/agentforce-offline-experimentation-run/scripts/bt_fetch.py +358 -0
- package/skills/agentforce-offline-experimentation-run/scripts/bt_patch_agent.py +110 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/__init__.py +34 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/agentpatch.py +483 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/agentsrc.py +565 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/cache.py +95 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/compare.py +617 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/fetch.py +1012 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/judge.py +140 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/messages.py +93 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/patch.py +327 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/redact.py +40 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/results.py +288 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/scoring.py +340 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/sfap.py +354 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/splits.py +136 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/stdm.py +98 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/tokens.py +173 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/units.py +199 -0
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/versions.py +194 -0
- package/skills/agentforce-offline-experimentation-run/scripts/build_report.py +367 -379
- package/skills/agentforce-offline-experimentation-run/scripts/resolve-token.sh +23 -6
- package/skills/agentforce-offline-experimentation-run/scripts/sfap_replay.py +483 -796
- package/skills/commerce-react-storefront-create/SKILL.md +54 -21
- package/skills/dx-lifecycle-center/SKILL.md +22 -13
- package/skills/dx-lifecycle-center/examples/workflows.md +54 -17
- package/skills/dx-lifecycle-center/references/connect-api.md +33 -4
- package/skills/dx-lifecycle-center/references/connect-org.md +62 -12
- package/skills/dx-lifecycle-center/references/deploy.md +3 -3
- package/skills/dx-lifecycle-center/references/hub-org.md +19 -3
- package/skills/dx-lifecycle-center/references/list-orgs.md +50 -24
- package/skills/dx-lifecycle-center/references/troubleshooting.md +22 -1
- package/skills/dx-lifecycle-center/scripts/hub-get.sh +41 -0
- package/skills/dx-lifecycle-center/scripts/resolve-environment.sh +151 -4
- package/skills/dx-org-devhub-configure/SKILL.md +85 -84
- package/skills/dx-org-devhub-configure/examples/status-output.md +25 -2
- package/skills/dx-org-devhub-configure/scripts/devhub.sh +265 -140
- package/skills/dx-org-devhub-configure/scripts/test-devhub.sh +100 -15
- package/skills/dx-packaging-convert-1gp-to-2gp-create/SKILL.md +63 -0
- package/skills/dx-packaging-convert-1gp-to-2gp-create/references/conversion-operations.md +252 -0
- package/skills/dx-packaging-move-to-2gp-migrate/SKILL.md +88 -0
- package/skills/dx-packaging-move-to-2gp-migrate/references/api-operations.md +167 -0
- package/skills/dx-packaging-push-upgrade-configure/README.md +47 -0
- package/skills/dx-packaging-push-upgrade-configure/SKILL.md +355 -0
- package/skills/dx-packaging-push-upgrade-configure/references/best-practices.md +61 -0
- package/skills/dx-packaging-push-upgrade-configure/references/cli-reference.md +148 -0
- package/skills/dx-packaging-push-upgrade-configure/references/objects.md +106 -0
- package/skills/dx-packaging-push-upgrade-configure/references/soql-recipes.md +144 -0
- package/skills/dx-scratch-def-configure/SKILL.md +163 -0
- package/skills/dx-scratch-def-configure/examples/confirm-card.md +53 -0
- package/skills/dx-scratch-def-configure/examples/report-recipes.md +100 -0
- package/skills/dx-scratch-def-configure/references/features.json +3270 -0
- package/skills/dx-scratch-def-configure/references/project-scratch-def.schema.json +1841 -0
- package/skills/dx-scratch-def-configure/references/settings-map.json +682 -0
- package/skills/dx-scratch-def-configure/scripts/lib_scratch_def.py +1306 -0
- package/skills/dx-scratch-def-configure/scripts/requirements.txt +3 -0
- package/skills/dx-scratch-def-configure/scripts/scrape_config_values.py +848 -0
- package/skills/education-cloud-domain-configure/SKILL.md +1 -1
- package/skills/education-cloud-multi-campus-configure/SKILL.md +1 -1
- package/skills/education-cloud-student-recruitment-agent-configure/SKILL.md +1 -1
- package/skills/experience-afv-analytics-query/SKILL.md +239 -0
- package/skills/experience-afv-analytics-query/references/references.md +176 -0
- package/skills/experience-app-mcp-delivery-generate/SKILL.md +142 -0
- package/skills/experience-app-mcp-delivery-generate/references/eca-consumer-key.md +26 -0
- package/skills/experience-app-mcp-delivery-generate/references/mcp-config-delivery.md +38 -0
- package/skills/experience-app-mcp-delivery-generate/references/plugin-format-and-publishing.md +80 -0
- package/skills/experience-app-mcp-delivery-generate/scripts/developer_name.mjs +9 -0
- package/skills/experience-app-mcp-delivery-generate/scripts/discover_mcp_context.mjs +114 -0
- package/skills/experience-app-mcp-delivery-generate/scripts/generate_mcp_config.mjs +27 -0
- package/skills/experience-app-mcp-delivery-generate/scripts/generate_plugin.mjs +184 -0
- package/skills/experience-app-mcp-delivery-generate/scripts/mcp_config.mjs +57 -0
- package/skills/experience-app-mcp-delivery-generate/scripts/preflight.mjs +109 -0
- package/skills/experience-app-mcp-delivery-generate/scripts/retrieve_eca_consumer_key.mjs +143 -0
- package/skills/experience-app-mcp-generate/SKILL.md +174 -0
- package/skills/experience-app-mcp-generate/assets/__ECA_NAME__.eca-meta.xml +7 -0
- package/skills/experience-app-mcp-generate/assets/__ECA_NAME__.ecaGlblOauth-meta.xml +15 -0
- package/skills/experience-app-mcp-generate/assets/__ECA_NAME__.ecaOauth-meta.xml +6 -0
- package/skills/experience-app-mcp-generate/assets/__ECA_NAME__.ecaOauthPlcy-meta.xml +12 -0
- package/skills/experience-app-mcp-generate/assets/__ECA_NAME___defaultPolicy.ecaPlcy-meta.xml +7 -0
- package/skills/experience-app-mcp-generate/assets/__MCP_SERVER_NAME__.mcpServerDefinition-meta.xml +5 -0
- package/skills/experience-app-mcp-generate/references/eca-fields.md +76 -0
- package/skills/experience-app-mcp-generate/references/mcp-objects.md +66 -0
- package/skills/experience-app-mcp-generate/references/tool-bindings.md +85 -0
- package/skills/experience-app-mcp-generate/references/troubleshooting.md +41 -0
- package/skills/experience-app-mcp-generate/references/ui-frameworks.md +19 -0
- package/skills/experience-app-mcp-generate/references/widget-resources.md +96 -0
- package/skills/experience-app-mcp-generate/scripts/activate_server.mjs +166 -0
- package/skills/experience-app-mcp-generate/scripts/check_setup_progress.mjs +212 -0
- package/skills/experience-app-mcp-generate/scripts/list_sites.mjs +211 -0
- package/skills/experience-app-mcp-generate/scripts/merge_tools.mjs +407 -0
- package/skills/experience-app-mcp-generate/scripts/preflight.mjs +127 -0
- package/skills/experience-app-mcp-generate/scripts/render_eca.mjs +144 -0
- package/skills/experience-app-mcp-generate/scripts/render_mcp_server.mjs +64 -0
- package/skills/experience-app-mcp-generate/scripts/retrieve_existing_prompts.mjs +145 -0
- package/skills/experience-app-mcp-generate/scripts/retrieve_existing_tools.mjs +72 -0
- package/skills/experience-app-mcp-generate/scripts/scan_tool_candidates.mjs +195 -0
- package/skills/experience-app-mcp-generate/scripts/utils/callback_url.mjs +36 -0
- package/skills/experience-app-mcp-generate/scripts/utils/developer_name.mjs +9 -0
- package/skills/experience-app-mcp-generate/scripts/utils/eca_check.mjs +156 -0
- package/skills/experience-app-mcp-generate/scripts/utils/metadata_path.mjs +13 -0
- package/skills/experience-app-mcp-generate/scripts/verify_server.mjs +118 -0
- package/skills/experience-cms-content-type-generate/SKILL.md +1 -1
- package/skills/experience-design-validate/SKILL.md +1 -1
- package/skills/experience-search-coordinate/SKILL.md +18 -12
- package/skills/experience-search-coordinate/references/content-route.md +79 -1
- package/skills/field-service-data-capture-migrate/SKILL.md +1 -1
- package/skills/nonprofit-fundraising-configure/SKILL.md +1 -1
- package/skills/nonprofit-fundraising-configure/references/mcp-invocation.md +52 -4
- package/skills/nonprofit-fundraising-configure/references/permission-targeting.md +19 -2
- package/skills/platform-apex-generate/SKILL.md +14 -11
- package/skills/platform-apex-test-generate/SKILL.md +2 -1
- package/skills/platform-custom-field-generate/SKILL.md +24 -16
- package/skills/platform-custom-metadata-type-generate/SKILL.md +1 -0
- package/skills/platform-custom-setting-generate/SKILL.md +1 -0
- package/skills/platform-datamask-run/SKILL.md +52 -71
- package/skills/platform-datamask-run/references/api-surface.md +10 -4
- package/skills/platform-datamask-run/references/policy-authoring.md +56 -7
- package/skills/platform-datamask-run/references/run-and-abort.md +17 -10
- package/skills/platform-datamask-run/scripts/poll-job.sh +15 -25
- package/skills/platform-dataspace-access-configure/SKILL.md +43 -10
- package/skills/platform-flexipage-generate/SKILL.md +7 -10
- package/skills/platform-flexipage-generate/references/mcp_action_examples.md +42 -38
- package/skills/platform-metadata-discovery-get/SKILL.md +185 -0
- package/skills/platform-metadata-discovery-get/references/api-map.md +25 -0
- package/skills/platform-metadata-discovery-get/references/h360-routes.md +30 -0
- package/skills/platform-metadata-discovery-get/references/scoped-soql.md +52 -0
- package/skills/platform-metadata-grounding-get/SKILL.md +170 -0
- package/skills/platform-policy-rule-generate/SKILL.md +85 -231
- package/skills/platform-policy-rule-generate/references/condition-model.md +47 -0
- package/skills/platform-policy-rule-generate/references/condition-templates.md +89 -0
- package/skills/platform-policy-rule-generate/references/conjunction-compiler.md +25 -0
- package/skills/platform-policy-rule-generate/references/conjunction-expression.md +30 -0
- package/skills/platform-policy-rule-generate/references/consumer-all.md +9 -0
- package/skills/platform-policy-rule-generate/references/consumer-datacloud-ui.md +99 -0
- package/skills/platform-policy-rule-generate/references/deploy-errors.md +24 -36
- package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/policyRuleDefinitionSets/ExistsJoinRLS.policyRuleDefinitionSet +5 -0
- package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/policyRuleDefinitions/ExistsJoinRLS_Rule_1.policyRuleDefinition +91 -0
- package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/policyRuleDefinitionSets/FieldReadDeny.policyRuleDefinitionSet +5 -0
- package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/policyRuleDefinitions/FieldReadDeny_Rule_1.policyRuleDefinition +72 -0
- package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/policyRuleDefinitionSets/LastCharactersFieldMasking.policyRuleDefinitionSet +5 -0
- package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/policyRuleDefinitions/LastCharactersFieldMasking_Rule_1.policyRuleDefinition +77 -0
- package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/policyRuleDefinitionSets/PrincipalFieldMatchRLS.policyRuleDefinitionSet +5 -0
- package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/policyRuleDefinitions/PrincipalFieldMatchRLS_Rule_1.policyRuleDefinition +77 -0
- package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/package.xml +12 -0
- package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/policyRuleDefinitionSets/TaggedObjectAccess.policyRuleDefinitionSet +5 -0
- package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/policyRuleDefinitions/TaggedObjectAccess_Rule_1.policyRuleDefinition +65 -0
- package/skills/platform-policy-rule-generate/references/headless-transport.md +87 -0
- package/skills/platform-policy-rule-generate/references/policy-schema-full.md +18 -11
- package/skills/platform-policy-rule-generate/references/policy-shapes.md +107 -0
- package/skills/platform-policy-rule-generate/references/principal-expression.md +31 -0
- package/skills/platform-policy-rule-generate/references/reference-resolution.md +51 -0
- package/skills/platform-policy-rule-generate/references/resource-expression.md +48 -0
- package/skills/platform-policy-rule-generate/references/runtime-context.md +9 -0
- package/skills/platform-policy-rule-generate/references/templates-access.md +11 -9
- package/skills/platform-policy-rule-generate/references/templates-advanced.md +5 -3
- package/skills/platform-policy-rule-generate/references/templates-record.md +37 -22
- package/skills/platform-policy-rule-generate/references/templates-transform.md +10 -8
- package/skills/platform-policy-rule-generate/references/templates.md +2 -2
- package/skills/platform-policy-rule-generate/references/ui-compatibility.md +36 -18
- package/skills/platform-report-generate/SKILL.md +29 -5
- package/skills/platform-report-generate/references/chart-types.md +26 -2
- package/skills/platform-report-generate/references/column-names.md +43 -0
- package/skills/platform-report-generate/references/errors-and-troubleshooting.md +1 -1
- package/skills/platform-report-generate/references/summary-formulas-sorting-limits.md +118 -0
- package/skills/platform-report-generate/references/verification-checklist.md +22 -2
- package/skills/service-digital-engagement-channel-configure/SKILL.md +49 -110
- package/skills/service-digital-engagement-channel-configure/assets/messaging_channel_template.xml +35 -0
- package/skills/service-digital-engagement-channel-configure/examples/asa_agent_channel.xml +2 -2
- package/skills/service-digital-engagement-channel-configure/examples/auth_queue_channel.xml +58 -0
- package/skills/service-digital-engagement-channel-configure/examples/omni_flow_channel.xml +2 -2
- package/skills/service-digital-engagement-channel-configure/examples/omni_queue_channel.xml +3 -3
- package/skills/service-digital-engagement-channel-configure/references/channel_settings.md +128 -28
- package/skills/service-digital-engagement-channel-configure/references/onboarding_contract.md +16 -20
- package/skills/service-digital-engagement-channel-configure/references/prechat_params.md +10 -0
- package/skills/service-digital-engagement-channel-configure/references/recaptcha_handoff.md +38 -0
- package/skills/service-digital-engagement-channel-configure/references/user_verification.md +9 -0
- package/skills/service-digital-engagement-channel-configure/scripts/check-api-version.sh +4 -4
- package/skills/service-digital-engagement-channel-configure/scripts/normalize-channel-name.sh +12 -7
- package/skills/service-e911-configure/SKILL.md +242 -0
- package/skills/service-itsm-agentic-setup-agent-runtime-access-assign/SKILL.md +1 -1
- package/skills/service-itsm-agentic-setup-agentforce-coordinate/SKILL.md +1 -1
- package/skills/service-itsm-agentic-setup-agentforce-studio-configure/SKILL.md +1 -1
- package/skills/service-itsm-agentic-setup-agentforce-studio-validate/SKILL.md +1 -1
- package/skills/service-itsm-agentic-setup-employee-agent-configure/SKILL.md +1 -1
- package/skills/service-itsm-agentic-setup-fulfiller-agent-configure/SKILL.md +1 -1
- package/skills/service-itsm-agentic-setup-incident-management/SKILL.md +47 -44
- package/skills/service-itsm-agentic-setup-incident-management/examples/output-templates.md +110 -83
- package/skills/service-itsm-agentic-setup-incident-management/references/manage-incidents-with-ai.md +7 -3
- package/skills/service-itsm-agentic-setup-incident-management/references/priority-matrix.md +7 -5
- package/skills/service-itsm-agentic-setup-incident-management/references/sla-milestones.md +2 -2
- package/skills/service-itsm-agentic-setup-incident-management/references/status-checks.md +437 -0
- package/skills/service-itsm-agentic-setup-itsm-agentforce-permset-assign/SKILL.md +1 -1
- package/skills/agentforce-bot-upgrade/references/planner-workflow-reference.md +0 -78
- package/skills/experience-content-media-image-generate/SKILL.md +0 -83
- package/skills/experience-content-media-image-generate/scripts/download-image.sh +0 -84
- package/skills/experience-content-media-stock-image-search/SKILL.md +0 -193
- package/skills/experience-content-media-stock-image-search/scripts/download-stock-image.py +0 -102
|
@@ -99,15 +99,25 @@ Prefer reusing an existing policy (fastest, no deploy):
|
|
|
99
99
|
sf data query --use-tooling-api --target-org <alias> \
|
|
100
100
|
--query "SELECT Id, DeveloperName, MasterLabel FROM DataMaskPolicy"
|
|
101
101
|
```
|
|
102
|
-
If none targets the
|
|
102
|
+
If none targets the object and fields you need, choose the fields first (below), then author one.
|
|
103
|
+
|
|
104
|
+
**Choose the fields from Core's classification, not from field names alone.** Before inserting any
|
|
105
|
+
`DataMaskPolicyField` row, call the field-classification operation once per target object and map each
|
|
106
|
+
`recommendedPiiType` to a treatment. The steps are in `references/policy-authoring.md` ("Choosing the
|
|
107
|
+
fields from Core's classification"). Any recommendation with no verified `MaskValue` token is reported
|
|
108
|
+
as unmapped; never guess a `MaskValue`. Use the static table only if the call fails, and say so in the
|
|
109
|
+
report.
|
|
110
|
+
|
|
111
|
+
Then author one with the **two-step** recipe (the
|
|
103
112
|
`DataMaskPolicy` Metadata shape is a thin shell; membership is Tooling-inserted):
|
|
104
113
|
1. **Metadata-deploy the thin shell** in **mdapi format** (`--metadata-dir` + `package.xml`; a
|
|
105
114
|
source-format `--source-dir` deploy fails "Could not infer a metadata type"). The shell carries
|
|
106
115
|
only `<label>`, `<description>`, `<runOnRefresh>`. This creates the policy *with an active
|
|
107
|
-
revision*, which
|
|
116
|
+
revision*, which the Tooling inserts in the next step require.
|
|
108
117
|
2. **Tooling-insert** the `DataMaskPolicyObject` (one per object) then its `DataMaskPolicyField`
|
|
109
|
-
rows. Each field row's treatment is `MaskingCategory`
|
|
110
|
-
token like `first_name`, `email`, `phone
|
|
118
|
+
rows. Each field row's treatment is `MaskingCategory` + `MaskValue`. For `library`, `MaskValue` is a
|
|
119
|
+
snake_case token like `first_name`, `email`, `phone`. For `characters` and `replaceRandom`, `MaskValue`
|
|
120
|
+
is the field's Salesforce type (`Text`, `Date`). There is **no `MaskingRuleType` column**.
|
|
111
121
|
|
|
112
122
|
> Insert order matters: a Tooling-created parent (no active revision) makes the child insert fail
|
|
113
123
|
> `INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY`. Metadata-deploy the shell first.
|
|
@@ -150,36 +160,36 @@ mid-run status as final.
|
|
|
150
160
|
|
|
151
161
|
**Jobs are slow — expect several minutes, and poll with the bundled script.** Data Mask runs on a
|
|
152
162
|
backend pool/scheduler with a **~5–10 minute floor**: even a tiny (20-row) job usually does **not**
|
|
153
|
-
reach a terminal state or emit detail rows for several minutes
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
"still pending" report.
|
|
163
|
+
reach a terminal state or emit detail rows for several minutes. This is fixed overhead, **not**
|
|
164
|
+
proportional to row count. The biggest failure mode is treating the job as instant, polling tightly,
|
|
165
|
+
and either timing out or writing a "still pending" report.
|
|
157
166
|
|
|
158
167
|
Run `scripts/poll-job.sh` as a **single command** — do **not** hand-roll a SOQL poll loop:
|
|
159
168
|
```bash
|
|
160
169
|
bash scripts/poll-job.sh <alias> <jobRunId> # defaults: cap 600s (10 min), 20s interval
|
|
161
170
|
```
|
|
162
|
-
It sleeps on a low-frequency interval,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
**
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
of it inline. Run the poller once, read its exit signal, then update `report.md` (the stub you wrote
|
|
173
|
-
before polling) with the terminal status and the masked count from A5.
|
|
171
|
+
It sleeps on a low-frequency interval, prints the terminal status (`completed` /
|
|
172
|
+
`completed_with_errors` / `failed` / `canceled`) on stdout, and exits `0` (or `1` on timeout).
|
|
173
|
+
**Call it once and read its result — do not wrap it in your own retry loop**, and do not poll on a
|
|
174
|
+
sub-10s interval (it just burns tool calls against a job that cannot finish sooner).
|
|
175
|
+
|
|
176
|
+
**The job is done only when the parent `DataMaskPolicyJobRun.Status` is terminal.** A
|
|
177
|
+
`DataMaskPolicyJobRunDtl` row is not a completion signal: a `total_records_masked` row can already
|
|
178
|
+
exist, reading `0`, while the parent is still `running`, so a count read mid-run is wrong. Wait for
|
|
179
|
+
the poller to exit `0`, then read the detail rows (A5) and update the `report.md` stub with the
|
|
180
|
+
terminal status and the masked count.
|
|
174
181
|
|
|
175
182
|
### A5. Report results from the job DETAIL object
|
|
176
183
|
The parent job carries an overall status; **per-object masked counts live on the child**
|
|
177
|
-
`DataMaskPolicyJobRunDtl` (linked by `DataMaskPolicyJobRunId`).
|
|
178
|
-
|
|
184
|
+
`DataMaskPolicyJobRunDtl` (linked by `DataMaskPolicyJobRunId`). `DataMaskPolicyJobRunDtl` has **no
|
|
185
|
+
`Status` column** — the status lives in `Type`/`Subtype`, with the count itself in `Value` (a
|
|
186
|
+
string). Report a concrete count, not a fabricated one:
|
|
179
187
|
```bash
|
|
180
188
|
sf data query --target-org <alias> \
|
|
181
|
-
--query "SELECT
|
|
189
|
+
--query "SELECT ObjectReference, Type, Subtype, Value FROM DataMaskPolicyJobRunDtl WHERE DataMaskPolicyJobRunId = '<jobRunId>' ORDER BY Timestamp"
|
|
182
190
|
```
|
|
191
|
+
Expect one `status_update` row per `Subtype` (`loaded`, `completed`, `total_records_masked`) for
|
|
192
|
+
each target object; `total_records_masked`'s `Value` is the masked count.
|
|
183
193
|
|
|
184
194
|
**Report only what the rows literally show — do not overstate granularity.** The detail rows are
|
|
185
195
|
**object-level** status_update entries (`loaded`, `completed`, `total_records_masked` for the object,
|
|
@@ -199,45 +209,28 @@ just to cancel it. Steps B1–B4 are all required.
|
|
|
199
209
|
|
|
200
210
|
### B1. Confirm sandbox + identify the run to cancel
|
|
201
211
|
Confirm the org is a sandbox (`sf org display`) and get the `jobRunId` of the run to abort — the one
|
|
202
|
-
the user is asking to cancel. **Capture its
|
|
203
|
-
|
|
204
|
-
|
|
212
|
+
the user is asking to cancel. **Capture its policy Id too** — you need it to start a replacement run
|
|
213
|
+
if the abort window is missed (B2 exit 3 / exit 1). If they just started it, use that policy id
|
|
214
|
+
directly; otherwise query for the active run:
|
|
205
215
|
```bash
|
|
206
216
|
sf data query --target-org <alias> \
|
|
207
|
-
--query "SELECT Id, Status,
|
|
217
|
+
--query "SELECT Id, Status, PolicyName FROM DataMaskPolicyJobRun ORDER BY CreatedDate DESC LIMIT 5"
|
|
208
218
|
```
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
### B2. Wait for the job to be `running` (the only abortable state)
|
|
212
|
-
You can only abort while `DataMaskPolicyJobRun.Status` is `running`. A `pending`/`scheduled` job
|
|
213
|
-
`409`s; a terminal one is already done. Poll for the `running` window with the bundled poller in its
|
|
214
|
-
**`running` mode** — it exits the instant the status reads `running` (unlike the default mode, which
|
|
215
|
-
waits for a terminal state), so it will not block past the abortable window:
|
|
219
|
+
`DataMaskPolicyJobRun` has **no `DataMaskPolicyId` lookup field** — the only link back to the policy
|
|
220
|
+
is the human-readable `PolicyName` (`MasterLabel`). Resolve the Id from it via the Tooling API:
|
|
216
221
|
```bash
|
|
217
|
-
|
|
222
|
+
sf data query --use-tooling-api --target-org <alias> \
|
|
223
|
+
--query "SELECT Id, DeveloperName FROM DataMaskPolicy WHERE MasterLabel = '<PolicyName>'"
|
|
218
224
|
```
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
--query "SELECT Id, Status FROM DataMaskPolicyJobRun WHERE Id = '<jobRunId>'"
|
|
229
|
-
```
|
|
230
|
-
If it is still non-terminal (`pending`/`scheduled`/`running`), re-run the poller **once** more (same
|
|
231
|
-
command) to continue waiting. If it is `running`, go to B3. If it is terminal, treat it like exit 3
|
|
232
|
-
— start a fresh run (A3 with the B1 `<policyId>`) and poll the new job.
|
|
233
|
-
|
|
234
|
-
Because of the ~5–10 min pool floor the `running` window is usually minutes wide, so there is time to
|
|
235
|
-
catch it; do not poll with no delay.
|
|
236
|
-
|
|
237
|
-
> **If no run is currently in progress** (the job already completed, or you must reproduce a
|
|
238
|
-
> run→cancel flow end to end), start one first with A3, then return here — poll it to `running` and
|
|
239
|
-
> abort **that** live job. Never substitute an older, already-terminal job to "show" a cancel; the
|
|
240
|
-
> abort must target the run that is actually live.
|
|
225
|
+
That `Id` (`8dm` prefix) is the `<policyId>` A3 needs.
|
|
226
|
+
|
|
227
|
+
### B2. Wait for the job to be `running` (the only abortable state)
|
|
228
|
+
Poll with `POLL_MODE=running` (cap 900s, 15s interval). Full command, exit-code handling (0 / 3 / 1),
|
|
229
|
+
and the re-query-on-timeout steps are in `references/run-and-abort.md` section 5. A `pending` or
|
|
230
|
+
`scheduled` job `409`s on abort, so do not abort until the poller exits `0`.
|
|
231
|
+
|
|
232
|
+
If no run is in progress, start one with A3 and abort **that** live job. Never substitute an older,
|
|
233
|
+
already-terminal job to "show" a cancel.
|
|
241
234
|
|
|
242
235
|
### B3. Abort via the run API
|
|
243
236
|
Abort via the run API — **not** by DML/delete on the job record:
|
|
@@ -263,14 +256,8 @@ Cancellation is asynchronous. **Re-query** `DataMaskPolicyJobRun` and confirm `S
|
|
|
263
256
|
| Rule | Rationale |
|
|
264
257
|
|------|-----------|
|
|
265
258
|
| Run each `sf` command **bare** — never add a pipe or redirect of any kind (`\|`, `\| python3`, `\| grep`, `2>&1`, `2>/dev/null`, `> file`) | `sf ... --json` already prints clean JSON on stdout; read it directly. A redirect/pipe trips an unbypassable shell-safety guard that silently stalls the whole run to timeout. Never post-process with `python3`/`grep`/`jq`, and never suppress stderr — even if a command prints a warning, the `--json` payload on stdout is still valid; just parse it as-is |
|
|
266
|
-
| Never use standard SOQL / `sobject describe` on `DataMaskPolicy*` config objects | They return `INVALID_TYPE` / `NOT_FOUND` — use Tooling API or MDAPI |
|
|
267
|
-
| Read masked counts from `DataMaskPolicyJobRunDtl`, never invent them | The child detail is the source of truth for per-object results |
|
|
268
|
-
| Only `completed` / `completed_with_errors` / `failed` are terminal | Reporting `running`/`scheduled` as final is wrong |
|
|
269
259
|
| Abort only via the run-API abort endpoint | DML/delete on the job record is not a real abort and corrupts state |
|
|
270
|
-
| Always re-query status after abort and confirm `canceled` | An abort call returning 200 is not proof the job stopped |
|
|
271
|
-
| Data Mask runs on sandboxes only | Run/abort endpoints `403` on production |
|
|
272
260
|
| Use API version `v67.0` or later, and no `/connect/` segment | The run/abort endpoints are `/services/data/v67.0/platform/data-resilience/data-mask/...` — a `connect` segment or a pre-v67 version returns `NOT_FOUND` |
|
|
273
|
-
| Poll via `scripts/poll-job.sh` (one call), never a hand-rolled SOQL loop | The script caps attempts and short-circuits on the ground-truth detail row; a manual loop against the lagging parent status is the #1 cause of a run timing out with no report |
|
|
274
261
|
|
|
275
262
|
---
|
|
276
263
|
|
|
@@ -278,15 +265,9 @@ Cancellation is asynchronous. **Re-query** `DataMaskPolicyJobRun` and confirm `S
|
|
|
278
265
|
|
|
279
266
|
| Issue | Resolution |
|
|
280
267
|
|-------|------------|
|
|
281
|
-
| `sf sobject describe DataMaskPolicy` → `NOT_FOUND` | It's a Tooling/MDAPI entity — query with `--use-tooling-api`, don't retry standard API |
|
|
282
|
-
| `SELECT ... FROM DataMaskPolicy` → `INVALID_TYPE` | Same cause — use Tooling API for the policy; standard API only for `DataMaskPolicyJobRun`/`Dtl` |
|
|
283
|
-
| Run start returns `409` | A run is already in progress for that policy — poll the existing one or wait for it to finish |
|
|
284
|
-
| Abort returns `409` "status=PENDING" | The job is still `pending`/`scheduled`, not yet `running` — keep polling and abort only once it reads `running`; don't give up on the abort |
|
|
285
268
|
| Small job finishes before you can abort it | The `running` window is seconds on a small sandbox — start a fresh run and poll tightly; never substitute a previously-aborted job to fake the flow |
|
|
286
|
-
|
|
|
287
|
-
| Run
|
|
288
|
-
| Job "finished" instantly | Re-check: `scheduled` is not terminal. Poll until a terminal value actually appears |
|
|
289
|
-
| Run/abort endpoint `NOT_FOUND` | The path must be `/services/data/v67.0/platform/data-resilience/data-mask/...` — no `/connect/` segment, and version `v67.0`+ (Core 262). See `references/api-surface.md` |
|
|
269
|
+
| Run API says `CANCELED` but SOQL says `running` | Case + surface differ (run API UPPERCASE, SOQL lowercase). Trust the SOQL value for terminal state |
|
|
270
|
+
| Run start returns `409` or abort `409` | Run start: a run is already active for that policy. Abort: the job is not `running` yet. Details in `references/run-and-abort.md` failure table |
|
|
290
271
|
|
|
291
272
|
---
|
|
292
273
|
|
|
@@ -30,8 +30,9 @@ authoritative map.
|
|
|
30
30
|
> then (2) Tooling-insert the object + field rows against it. The Metadata deploy must come first:
|
|
31
31
|
> it creates the policy with an active revision, without which the Tooling child insert fails
|
|
32
32
|
> `INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY`. See `policy-authoring.md` for the full recipe.
|
|
33
|
-
> `DataMaskPolicyField` treatment columns are `MaskingCategory` (`library` / `
|
|
34
|
-
> `MaskValue` (a snake_case library token
|
|
33
|
+
> `DataMaskPolicyField` treatment columns are `MaskingCategory` (`library` / `characters` /
|
|
34
|
+
> `replaceRandom`) + `MaskValue` (a snake_case library token for `library`, or the field's Salesforce
|
|
35
|
+
> type such as `Text` / `Date` for `characters` / `replaceRandom`) — there is **no `MaskingRuleType` column**.
|
|
35
36
|
|
|
36
37
|
> **Schedule fields live ON the policy** — there is no separate schedule entity. `RunFrequency`
|
|
37
38
|
> (`once` / `daily` / `weekly` / `monthly`), `ScheduledStart`, and `RunOnRefresh` are fields on
|
|
@@ -64,11 +65,16 @@ sf data query --use-tooling-api --target-org <alias> \
|
|
|
64
65
|
|
|
65
66
|
# RIGHT — job + job-detail via standard API:
|
|
66
67
|
sf data query --target-org <alias> \
|
|
67
|
-
--query "SELECT Id, Status, Type,
|
|
68
|
+
--query "SELECT Id, Status, Type, PolicyName FROM DataMaskPolicyJobRun ORDER BY CreatedDate DESC LIMIT 5"
|
|
68
69
|
sf data query --target-org <alias> \
|
|
69
|
-
--query "SELECT
|
|
70
|
+
--query "SELECT ObjectReference, Type, Subtype, Value FROM DataMaskPolicyJobRunDtl WHERE DataMaskPolicyJobRunId = '<jobRunId>' ORDER BY Timestamp"
|
|
70
71
|
```
|
|
71
72
|
|
|
73
|
+
`DataMaskPolicyJobRun` has **no `TotalRecords`** and **no `DataMaskPolicyId`** lookup field —
|
|
74
|
+
resolve the policy from `PolicyName` (`MasterLabel`) via the Tooling API instead.
|
|
75
|
+
`DataMaskPolicyJobRunDtl` has **no `Status`** column — status lives in `Type`/`Subtype`, and the
|
|
76
|
+
masked count is `Value` on the row where `Subtype = 'total_records_masked'`.
|
|
77
|
+
|
|
72
78
|
## Status picklist values (`DataMaskPolicyJobRun.Status`)
|
|
73
79
|
|
|
74
80
|
```text
|
|
@@ -91,13 +91,62 @@ Each `DataMaskPolicyField` carries a `MaskingCategory` plus a `MaskValue` — th
|
|
|
91
91
|
`MaskingRuleType` column** (older docs claiming values like `RandomEmail` / `RandomPhoneNumber`
|
|
92
92
|
were wrong; that column does not exist).
|
|
93
93
|
|
|
94
|
-
- `MaskingCategory` — `library` (pick a value from the built-in library, the common case)
|
|
95
|
-
`replaceRandom` (random replacement).
|
|
96
|
-
- `MaskValue`
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
94
|
+
- `MaskingCategory` — `library` (pick a value from the built-in library, the common case),
|
|
95
|
+
`characters` (random characters), or `replaceRandom` (random replacement).
|
|
96
|
+
- `MaskValue` depends on the category:
|
|
97
|
+
- `library` — a snake_case library token identifying the value set. Verified tokens include:
|
|
98
|
+
`first_name`, `last_name`, `email`, `phone`, `street`, `city`, `state`, `postal_code`,
|
|
99
|
+
`country`, `account_name`, `URL`.
|
|
100
|
+
- `characters` and `replaceRandom` — the field's Salesforce type (for example `Text`, `Date`).
|
|
101
|
+
Left empty, the run fails with `UNKNOWN_EXCEPTION` ("Mask Value is required for Replace Random
|
|
102
|
+
field").
|
|
103
|
+
|
|
104
|
+
## Choosing the fields from Core's classification
|
|
105
|
+
|
|
106
|
+
The Data Mask UI's "Automatic PII rules" are driven by a per-field `recommendedPiiType` that Core's
|
|
107
|
+
classifier computes. Use the same source here so the skill and the UI recommend the same fields. Do
|
|
108
|
+
this once per target object, before inserting any `DataMaskPolicyField` row.
|
|
109
|
+
|
|
110
|
+
1. **Call the classification operation** through the `project-codey` server's `dispatch_readonly`
|
|
111
|
+
tool. It takes a `path`, not an operationId: `path`
|
|
112
|
+
`/headless/invoke/platform/datamask/data-mask-policy/get-object-fields-with-masking-info`, `method`
|
|
113
|
+
`GET`, and `query_params` `{objectApiName: <object>, includePicklistValues: false,
|
|
114
|
+
includeFilterOnlyFields: false}` (for example `objectApiName: "Contact"`). Omit `policyObjectId` (a
|
|
115
|
+
new object has no `DataMaskPolicyObject` row yet). If this path 404s, re-resolve it with `find_route`
|
|
116
|
+
rather than guessing. The `.../data-mask-policy-builder/...` route serves the same operation but does
|
|
117
|
+
not take the two picklist/filter params.
|
|
118
|
+
2. **Read the response.** The result is `{status_code, body}`, where `body` is an array with one entry
|
|
119
|
+
per field. Each entry carries `apiName`, `label`, `type`, and `recommendedPiiType` (`null` when Core
|
|
120
|
+
has no recommendation). Any other shape counts as a failed call (step 4).
|
|
121
|
+
3. **Map each recommendation to a treatment.** Core returns tokens such as `last_name`, `street`,
|
|
122
|
+
`phone`, `characters`, and `replaceRandom`. Compare `recommendedPiiType` case-insensitively with the
|
|
123
|
+
verified `MaskValue` tokens in "Field treatment columns" above. `characters` and `text` are the same
|
|
124
|
+
category.
|
|
125
|
+
- A verified token → `MaskingCategory=library`, `MaskValue=<that token>`.
|
|
126
|
+
- `characters`/`text` → `MaskingCategory=characters`. `replaceRandom` → `MaskingCategory=replaceRandom`.
|
|
127
|
+
Both also require `MaskValue` = the field's Salesforce type as Core reports it in `type` (for example
|
|
128
|
+
`Text`, `Date`). The UI's "Mask With" menu offers `Random Characters` for `characters`.
|
|
129
|
+
- Any other recommendation (for example `title`, `full_name`, `full_address`, `credit_card`, `ssn`,
|
|
130
|
+
`password`, `date`, `numberRange`) has no `MaskingCategory` or verified token here. **Report it as
|
|
131
|
+
unmapped. Do not guess a `MaskValue`.**
|
|
132
|
+
- A field with no `recommendedPiiType` is not masked. List it in the report.
|
|
133
|
+
4. **Fall back only when the call fails** (refused, errored, the `project-codey` server is unavailable,
|
|
134
|
+
or the response shape is unrecognized). Then use the static table below and state in the report that
|
|
135
|
+
the field list came from the static table, not from Core. When the call succeeds, Core's answer is
|
|
136
|
+
authoritative. Do not add fields from the static table.
|
|
137
|
+
|
|
138
|
+
## Fallback treatments (static table)
|
|
139
|
+
|
|
140
|
+
Use this table **only** when the classification call in "Choosing the fields from Core's classification"
|
|
141
|
+
fails. When the call succeeds, use Core's `recommendedPiiType` and skip this table. The table is narrower than Core:
|
|
142
|
+
|
|
143
|
+
- It covers only the standard fields listed below. It does not apply Core's label, type, or encryption
|
|
144
|
+
rules, so it misses fields Core does recommend (for Contact: the Other* address fields, `Fax`,
|
|
145
|
+
`HomePhone`, `OtherPhone`, `AssistantPhone`).
|
|
146
|
+
- Core's type-based fallback classifies some text fields as `characters` (for Contact, `AssistantName`)
|
|
147
|
+
and some date fields as `replaceRandom` (for Contact, `Birthdate`). Both map to their `MaskingCategory`
|
|
148
|
+
value with `MaskValue` set to the field's Salesforce type (`Text` for AssistantName, `Date` for
|
|
149
|
+
Birthdate), so they are masked, not reported as unmapped.
|
|
101
150
|
|
|
102
151
|
Match the `MaskValue` to the field's semantics — do **not** apply one blanket replacement:
|
|
103
152
|
|
|
@@ -48,28 +48,35 @@ Capture `jobRunId`. A `409`/`CONFLICT` means a run is already active for this po
|
|
|
48
48
|
## 3. Poll to terminal
|
|
49
49
|
```bash
|
|
50
50
|
sf data query --target-org <alias> \
|
|
51
|
-
--query "SELECT Id, Status, Type
|
|
51
|
+
--query "SELECT Id, Status, Type FROM DataMaskPolicyJobRun WHERE Id = '<jobRunId>'"
|
|
52
52
|
```
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
`DataMaskPolicyJobRun` has **no `TotalRecords` field** — there is no record-count column on the
|
|
54
|
+
parent; the masked count lives on the child detail rows (step 4). Repeat the status query on a
|
|
55
|
+
bounded interval until `Status` is one of `completed`, `completed_with_errors`, `failed`.
|
|
56
|
+
`scheduled`/`running` are NOT terminal. `scripts/poll-job.sh` automates this with a timeout.
|
|
56
57
|
|
|
57
58
|
## 4. Report from the detail object
|
|
58
|
-
Per-object masked results live on the child, not the parent
|
|
59
|
+
Per-object masked results live on the child, not the parent. `DataMaskPolicyJobRunDtl` has **no
|
|
60
|
+
`Status` column** — the status lives in `Type`/`Subtype`, with the count itself in `Value` (a
|
|
61
|
+
string):
|
|
59
62
|
```bash
|
|
60
63
|
sf data query --target-org <alias> \
|
|
61
|
-
--query "SELECT
|
|
64
|
+
--query "SELECT ObjectReference, Type, Subtype, Value FROM DataMaskPolicyJobRunDtl WHERE DataMaskPolicyJobRunId = '<jobRunId>' ORDER BY Timestamp"
|
|
62
65
|
```
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
Expect one `status_update` row per `Subtype` (`loaded`, `completed`, `total_records_masked`) for
|
|
67
|
+
each target object; `total_records_masked`'s `Value` is the masked count. Report the concrete
|
|
68
|
+
masked-record count and per-object success/failure from these rows. Do not report a number you did
|
|
69
|
+
not read from here.
|
|
65
70
|
|
|
66
71
|
## 5. Abort the currently-running job — ONLY when the user asked to cancel
|
|
67
72
|
Steps 5–7 are the **abort** flow. Run them **only when the prompt explicitly asks to cancel/abort**
|
|
68
73
|
a run — a "create and run" or "edit and run" task is complete after step 4.
|
|
69
74
|
|
|
70
75
|
Aborting is an **on-demand action against a job that is already in progress**: take that job's
|
|
71
|
-
`jobRunId` (and note its
|
|
72
|
-
missed
|
|
76
|
+
`jobRunId` (and note its policy Id — you need it to start a replacement run if the window is
|
|
77
|
+
missed; `DataMaskPolicyJobRun` has no direct policy lookup field, so resolve it from the job's
|
|
78
|
+
`PolicyName` via `SELECT Id FROM DataMaskPolicy WHERE MasterLabel = '<PolicyName>'` against the
|
|
79
|
+
Tooling API), wait for `DataMaskPolicyJobRun.Status = running`, and go straight to the abort (step 6).
|
|
73
80
|
You can only abort a running job. Do **not** use the terminal poll from step 3 here — it waits until
|
|
74
81
|
the job is *done*. Use the poller's `running` mode, which returns the instant the job is abortable:
|
|
75
82
|
```bash
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
# so the default cap is 600s (10 min) with a 20s interval to keep the query volume low. Do NOT poll
|
|
18
18
|
# on a tight (sub-10s) interval — it just burns tool calls against a job that cannot finish sooner.
|
|
19
19
|
#
|
|
20
|
-
# TERMINAL MODE:
|
|
21
|
-
#
|
|
22
|
-
#
|
|
23
|
-
#
|
|
20
|
+
# TERMINAL MODE: exits only on a terminal PARENT status. A `total_records_masked` detail row is NOT a
|
|
21
|
+
# completion signal: it can already exist, reading `0`, while the parent is still `running`, so
|
|
22
|
+
# stopping on the first row reports a count for a job that has not finished. Read the detail rows
|
|
23
|
+
# only AFTER this script exits.
|
|
24
24
|
#
|
|
25
25
|
# RUNNING MODE (for abort): exits the instant the parent status reads `running` — the only state in
|
|
26
26
|
# which the abort endpoint accepts the request (a `pending`/`scheduled` job 409s). Because the pool
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
# start a fresh run rather than abort a job that already finished.
|
|
31
31
|
#
|
|
32
32
|
# Exit codes:
|
|
33
|
-
# terminal mode: 0 = terminal status
|
|
33
|
+
# terminal mode: 0 = terminal parent status observed (printed on stdout);
|
|
34
34
|
# 1 = timed out; 2 = bad args.
|
|
35
35
|
# running mode: 0 = `running` observed (prints `running`); 1 = timed out; 2 = bad args;
|
|
36
36
|
# 3 = job reached a terminal state before `running` was seen (prints that status).
|
|
@@ -63,12 +63,15 @@ is_terminal() {
|
|
|
63
63
|
|
|
64
64
|
elapsed=0
|
|
65
65
|
while (( elapsed < MAX_SECONDS )); do
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
# CSV is a header line then one value per row, so bash can read it with no pipe and no
|
|
67
|
+
# post-processor. stderr is left attached so an auth or alias failure is visible; a failed
|
|
68
|
+
# query only skips this tick, it does not end the poll.
|
|
69
|
+
csv="$(sf data query --target-org "$ORG" \
|
|
70
|
+
--query "SELECT Status FROM DataMaskPolicyJobRun WHERE Id = '${JOB_ID}'" \
|
|
71
|
+
--result-format csv)" || csv=""
|
|
72
|
+
status=""
|
|
73
|
+
{ IFS= read -r _; IFS= read -r status; } <<< "$csv" || true
|
|
74
|
+
status="${status:-UNKNOWN}"
|
|
72
75
|
echo "[poll-job] ${JOB_ID} status=${status} (${elapsed}s/${MAX_SECONDS}s) mode=${POLL_MODE}"
|
|
73
76
|
|
|
74
77
|
if [[ "$POLL_MODE" == "running" ]]; then
|
|
@@ -88,19 +91,6 @@ while (( elapsed < MAX_SECONDS )); do
|
|
|
88
91
|
echo "$status"
|
|
89
92
|
exit 0
|
|
90
93
|
fi
|
|
91
|
-
|
|
92
|
-
# Ground-truth check: a masked-count detail row means the job finished even if the parent lags.
|
|
93
|
-
masked="$(
|
|
94
|
-
sf data query --target-org "$ORG" \
|
|
95
|
-
--query "SELECT Value FROM DataMaskPolicyJobRunDtl WHERE DataMaskPolicyJobRunId = '${JOB_ID}' AND Subtype = 'total_records_masked'" \
|
|
96
|
-
--json 2>/dev/null \
|
|
97
|
-
| python3 -c "import json,sys; r=json.load(sys.stdin).get('result',{}).get('records',[]); print(r[0]['Value'] if r else '')"
|
|
98
|
-
)"
|
|
99
|
-
if [[ -n "$masked" ]]; then
|
|
100
|
-
echo "[poll-job] detail row total_records_masked=${masked} — job effectively complete (parent status=${status})"
|
|
101
|
-
echo "completed"
|
|
102
|
-
exit 0
|
|
103
|
-
fi
|
|
104
94
|
fi
|
|
105
95
|
|
|
106
96
|
sleep "$INTERVAL"
|
|
@@ -110,6 +100,6 @@ done
|
|
|
110
100
|
if [[ "$POLL_MODE" == "running" ]]; then
|
|
111
101
|
echo "[poll-job] TIMEOUT after ${MAX_SECONDS}s — job never reached 'running'" >&2
|
|
112
102
|
else
|
|
113
|
-
echo "[poll-job] TIMEOUT after ${MAX_SECONDS}s —
|
|
103
|
+
echo "[poll-job] TIMEOUT after ${MAX_SECONDS}s — job never reached a terminal status" >&2
|
|
114
104
|
fi
|
|
115
105
|
exit 1
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: platform-dataspace-access-configure
|
|
3
|
-
description: "
|
|
3
|
+
description: "Grant a permission set Data Cloud access two ways: (1) data-space (dataspace) access via dataspaceScopes in PermissionSet XML (MDAPI) — create, change, or remove it; (2) object-level access to a DMO/DLO/CIO object (e.g. Account__dlm) via the Object Access Grants Connect API (ssot/data-governance/object-access-grants) — grant, list, revoke; plus read-only scope inspection. TRIGGER on: dataspace scope / data space access for a permission set, dataAccessLevel / objectAccessLevel, 'use the Connect API to grant a permission set access to an <object>__dlm', RBAC object grants. DO NOT TRIGGER for creating the dataspace itself (the Data 360 data-space skill), a generic permission set with no dataspace access (platform-permission-set-generate), or an access policy / policy rule / tag-based access (platform-policy-rule-generate). For a vague object-access ask, ask permission-set way vs policy way."
|
|
4
4
|
metadata:
|
|
5
5
|
relatedSkills:
|
|
6
6
|
- "platform-permission-set-generate"
|
|
7
|
+
- "platform-policy-rule-generate"
|
|
7
8
|
version: "1.0"
|
|
8
9
|
domains: ["Platform", "Data 360"]
|
|
9
10
|
minApiVersion: "67.0"
|
|
@@ -27,31 +28,63 @@ The MDAPI layer is required to establish the PermissionSet → DataSpace linkage
|
|
|
27
28
|
|
|
28
29
|
---
|
|
29
30
|
|
|
31
|
+
## When to use this skill (routing)
|
|
32
|
+
|
|
33
|
+
This is the **permission-set / RBAC** path to Data Cloud access:
|
|
34
|
+
|
|
35
|
+
- **"Grant access to a data space" / dataspace access** → this skill (Layer 1, `dataspaceScopes` on a permission set).
|
|
36
|
+
- **Grant object access via a permission set / RBAC object grant** → this skill (Layer 2, Object Access Grants Connect API).
|
|
37
|
+
|
|
38
|
+
Object access has a second, separate path — a **data-governance access policy** (a tag/OLS `PolicyRuleDefinition`), owned by **`platform-policy-rule-generate`**. Infer the mechanism from context; ask only when the request is vague:
|
|
39
|
+
|
|
40
|
+
- The user is **driving from a permission set** (mentions a permission set, RBAC, or an object grant on a permset) → object access grant → **this skill**, no need to ask.
|
|
41
|
+
- The user **frames it as a policy** (create a policy / access policy / policy rule, OLS/FLS/RLS, tag/classification-based) → route to **`platform-policy-rule-generate`**.
|
|
42
|
+
- The request is **genuinely vague** — "grant object access to X" with no mechanism and no clue → **ASK**: the **permission-set way** (this skill) or the **policy way** (`platform-policy-rule-generate`)? If it is also unclear whether the object is a Data Cloud object, ask which object first.
|
|
43
|
+
|
|
44
|
+
"Access to a **data space**" is always this skill (the permission-set / `dataspaceScopes` path) — no disambiguation needed.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
30
48
|
## Decide the Case First
|
|
31
49
|
|
|
50
|
+
> **Case B — preserve existing content.** Do not delete content you did not intend to change without the user's confirmation. Fix deploy or validation errors that trace to your own `<dataspaceScopes>` block (wrong element or enum names). For errors that originate in pre-existing content you were told to preserve (e.g. a `<tabSettings>` or `<fieldPermissions>` entry), make no further edits to that content and report the error message and the offending element in your reply. A request to fix validation errors does not authorize removing content the user told you to preserve; deleting it needs the user's explicit confirmation.
|
|
51
|
+
|
|
32
52
|
Pick exactly one case from the table below before writing any files. Each case has a different output shape.
|
|
33
53
|
|
|
34
54
|
| Case | User intent | Permission set state | Files to emit |
|
|
35
55
|
|---|---|---|---|
|
|
36
|
-
| **A. Create new permset with DS access** | "create a permission set called X with dataspace scope Y" | does NOT exist yet | `permissionsets/<Name>.permissionset-meta.xml` **and** `package.xml` |
|
|
37
|
-
| **B. Add DS access to existing permset** | "grant existing permission set X access to dataspace Y" | already deployed (may contain other permissions) | patched `permissionsets/<Name>.permissionset-meta.xml` **and** `package.xml` — see Case B workflow below |
|
|
56
|
+
| **A. Create new permset with DS access** | "create a permission set called X with dataspace scope Y" | does NOT exist yet | `permissionsets/<Name>.permissionset-meta.xml` **and** `package.xml` (create `package.xml` only if absent) |
|
|
57
|
+
| **B. Add DS access to existing permset** | "grant existing permission set X access to dataspace Y" | already deployed (may contain other permissions) | patched `permissionsets/<Name>.permissionset-meta.xml` **and** `package.xml` (keep the existing one if present; create only if absent) — see Case B workflow below |
|
|
38
58
|
| **C. Object-level grant only** | "grant permset X access to object Z (in dataspace Y)" — permset + scope already configured | already deployed with `dataspaceScopes` | `api-request.json` (Connect API body). NO permission set XML, NO `package.xml` |
|
|
39
59
|
| **D. Inspect existing DS access** | "which permission sets have access to dataspace Y?" | any | chat/report only. NO deployable files, NO runtime API mutation |
|
|
40
60
|
|
|
41
61
|
Only emit the files listed for the case you picked. Emitting Case A/B files for a Case C prompt (or vice versa) is a correctness failure — extra files change the deployment shape.
|
|
42
62
|
|
|
43
|
-
> **Case B — critical:** PermissionSet MDAPI deploy is a **full metadata replace**. Every `<objectPermissions>`, `<fieldPermissions>`, `<userPermissions>`, `<tabSettings>`, `<applicationVisibilities>`, `<recordTypeVisibilities>`, `<customPermissions>`, `<pageAccesses>`, `<classAccesses>`, `<customMetadataTypeAccesses>`, `<customSettingAccesses>`, `<externalDataSourceAccesses>` element you omit from the redeploy is **deleted from the org**. Before adding `<dataspaceScopes>`
|
|
63
|
+
> **Case B — critical:** PermissionSet MDAPI deploy is a **full metadata replace**. Every `<objectPermissions>`, `<fieldPermissions>`, `<userPermissions>`, `<tabSettings>`, `<applicationVisibilities>`, `<recordTypeVisibilities>`, `<customPermissions>`, `<pageAccesses>`, `<classAccesses>`, `<customMetadataTypeAccesses>`, `<customSettingAccesses>`, `<externalDataSourceAccesses>` element you omit from the redeploy is **deleted from the org**. Before adding, changing, or removing `<dataspaceScopes>` on an existing permset, start from its current XML and patch it — never author a permission set from scratch or write placeholder comments such as "replace with actual permissions", and never invent permissions that are not in the file.
|
|
44
64
|
|
|
45
65
|
### Case B workflow
|
|
46
66
|
|
|
47
|
-
|
|
67
|
+
0. **Local project first.** If the workspace already contains `permissionsets/<Name>.permissionset-meta.xml` (e.g. under `force-app/main/default/`), READ that file first and edit it in place — it is the current XML; no org or retrieve is needed. Also reuse an existing `package.xml` as-is (add the permset to `<members>` only if missing). If no org is connected, do not stop to ask; use the workspace files.
|
|
68
|
+
1. Only when the file is not in the workspace and an org is available, retrieve the existing permission set:
|
|
48
69
|
```bash
|
|
49
70
|
sf project retrieve start --metadata PermissionSet:<Name> --target-org <alias>
|
|
50
71
|
```
|
|
51
|
-
2. Open
|
|
52
|
-
3. Insert the `<dataspaceScopes>` block for the target DataSpace (element order in the file does not matter for MDAPI). If the file already has a `<dataspaceScopes>` block **for this same DataSpace**, replace only that block. Leave every `<dataspaceScopes>` block for other DataSpaces untouched — one block per DataSpace. For a requested scope removal,
|
|
53
|
-
4.
|
|
72
|
+
2. Open `permissionsets/<Name>.permissionset-meta.xml` (workspace copy or retrieved). Keep every element already there, byte-for-byte except the intended `<dataspaceScopes>` change.
|
|
73
|
+
3. Insert the `<dataspaceScopes>` block for the target DataSpace (element order in the file does not matter for MDAPI). If the file already has a `<dataspaceScopes>` block **for this same DataSpace**, replace only that block. Leave every `<dataspaceScopes>` block for other DataSpaces untouched — one block per DataSpace. For a requested scope removal (revoke), delete ONLY that block; the `<fieldPermissions>`, `<objectPermissions>` and `<tabSettings>` counts must match the original. Omitting the block revokes that DataSpace grant. Verify by retrieving the PermissionSet and confirming the matching `<dataspaceScopes>` block is absent.
|
|
74
|
+
4. Ensure `package.xml` lists the permset in `<members>` (create it only if absent).
|
|
54
75
|
5. Redeploy with `sf project deploy start`.
|
|
76
|
+
6. If deploy validation reports errors on elements you did not touch (e.g. `no CustomTab named Opportunity found` on a preserved `<tabSettings>`), leave them in place and report the message and offending element. **Stop-and-ask rule:** if the user then says "fix it", "fix the validation error" or "make it deploy", that is NOT confirmation to delete — do not remove, comment out or edit that element in any way. Reply that the entry was explicitly preserved, name the element, and ask whether they want it removed; delete it only after they answer yes to that specific question.
|
|
77
|
+
|
|
78
|
+
### Choosing the access levels from the request wording
|
|
79
|
+
|
|
80
|
+
| User wording | `dataAccessLevel` | `objectAccessLevel` |
|
|
81
|
+
|---|---|---|
|
|
82
|
+
| "governed by data governance policies" / "controlled by policy" | as stated; if the request does not state a `dataAccessLevel`, ask which one (do not silently default to `ALL`) | `BY_POLICY` |
|
|
83
|
+
| "remove" / "revoke" the dataspace access | no level — remove the matching `<dataspaceScopes>` block (see Case B step 3); `NONE` keeps the scope but grants no data | n/a |
|
|
84
|
+
| "controlled by the dataspace scope itself / by the parent" **and** "access to everything / all objects in the dataspace" | `CONTROLLED_BY_PARENT` | `ALL_IN_DATASPACE` |
|
|
85
|
+
| An explicit level named in the request | use it verbatim | use it verbatim |
|
|
86
|
+
|
|
87
|
+
`ALL_IN_DATASPACE` is only valid with `CONTROLLED_BY_PARENT`; do not pair it with `ALL`.
|
|
55
88
|
|
|
56
89
|
---
|
|
57
90
|
|
|
@@ -106,7 +139,7 @@ Embed a `<dataspaceScopes>` element inside the `PermissionSet` XML. Deploy with
|
|
|
106
139
|
|
|
107
140
|
### Package Layout (Case A and Case B)
|
|
108
141
|
|
|
109
|
-
A deployable bundle for Layer 1
|
|
142
|
+
A deployable bundle for Layer 1 contains **both** files (reuse an existing `package.xml`; create it only if absent):
|
|
110
143
|
|
|
111
144
|
```text
|
|
112
145
|
<output-root>/
|
|
@@ -114,7 +147,7 @@ A deployable bundle for Layer 1 always contains **both** files:
|
|
|
114
147
|
permissionsets/<Name>.permissionset-meta.xml
|
|
115
148
|
```
|
|
116
149
|
|
|
117
|
-
`package.xml` (
|
|
150
|
+
`package.xml` (list every permission set being deployed in `<members>`):
|
|
118
151
|
|
|
119
152
|
```xml
|
|
120
153
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
@@ -3,18 +3,14 @@ name: platform-flexipage-generate
|
|
|
3
3
|
description: "Use when users create, generate, modify, or validate Salesforce Lightning pages (FlexiPages). Trigger on RecordPage, AppPage, HomePage, Lightning pages, adding components to a page, page customization (e.g. 'customize the record page'), or .flexipage-meta.xml files (regions, components, deployment errors). DO NOT TRIGGER for Visualforce pages, page layout assignments in the UI, UI Bundle/Experience Cloud site pages, or Aura/Lightning Web Component development without FlexiPage context."
|
|
4
4
|
allowed-tools: Bash Read Write
|
|
5
5
|
metadata:
|
|
6
|
-
version: "1.
|
|
6
|
+
version: "1.2"
|
|
7
7
|
domains: ["Platform"]
|
|
8
|
-
minApiVersion: "
|
|
8
|
+
minApiVersion: "68.0"
|
|
9
9
|
cliTools:
|
|
10
10
|
- tool: ["python3"]
|
|
11
11
|
semver: ">=3.10.0"
|
|
12
12
|
- tool: ["sf"]
|
|
13
13
|
semver: ">=2.126.4"
|
|
14
|
-
mcpTools:
|
|
15
|
-
metadata-experts:
|
|
16
|
-
tools: ["execute_metadata_action"]
|
|
17
|
-
semver: ">=1.0.0"
|
|
18
14
|
---
|
|
19
15
|
|
|
20
16
|
## When to Use This Skill
|
|
@@ -227,7 +223,7 @@ Complete each tier for ALL components before moving to the next tier — do NOT
|
|
|
227
223
|
| Tier | Source | When | Calls |
|
|
228
224
|
|------|--------|------|-------|
|
|
229
225
|
| **1** | Local workspace scan | Always first — run for ALL components | 0 (local only) |
|
|
230
|
-
| **2** | `discoverUiComponents`
|
|
226
|
+
| **2** | `discoverUiComponents` invocable action | Single call for all components unresolved after Tier 1 | 1 |
|
|
231
227
|
| **3** | Generate new LWC bundle | Only for components still unresolved after Tier 2 + user confirms | 0 |
|
|
232
228
|
|
|
233
229
|
After Tier 1 completes for all components, collect only the unresolved ones and pass them to Tier 2 in a single MCP call. Only components still unresolved after Tier 2 proceed to Tier 3.
|
|
@@ -279,14 +275,15 @@ sf project deploy start --dry-run -d "<packageDirectory>/main/default" --test-le
|
|
|
279
275
|
|
|
280
276
|
**Read `references/mcp_action_examples.md`** for full input/output examples and parameter tables.
|
|
281
277
|
|
|
282
|
-
Two
|
|
278
|
+
Two invocable actions, called with the `dispatch` MCP tool against `POST /services/data/<ver>/headless/invocableaction`. The body is `{ "action": "<action>", "inputs": { ... } }`; results come back under `outputs`:
|
|
283
279
|
|
|
284
280
|
| Action | Purpose | When |
|
|
285
281
|
|--------|---------|------|
|
|
286
|
-
| `
|
|
287
|
-
| `
|
|
282
|
+
| `discoverUiComponents-discoverUiComponents` | Find components for a page type | Tier 2 discovery — single call for all unresolved components |
|
|
283
|
+
| `getUiComponentSchemas-getUiComponentSchemas` | Get property schemas | Property inference Step 1 (Tier 2 org components only) |
|
|
288
284
|
|
|
289
285
|
**Key conventions:**
|
|
286
|
+
- `<ver>` is the API version: use `v68.0` or later. On earlier versions both calls fail with "apiVersion not supported in current API version"
|
|
290
287
|
- Component definition format: `namespace/blockName` (forward-slash) in MCP calls, `namespace:blockName` (colon) in XML
|
|
291
288
|
- `pageContext` with `entityName` is required for RECORD_PAGE
|
|
292
289
|
- `getUiComponentSchemas` supports partial failures — check each component's `success` boolean
|