@salesforce/afv-skills 1.68.0 → 1.70.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/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/scripts/btlib/judge.py +23 -31
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/messages.py +2 -1
- package/skills/agentforce-offline-experimentation-run/scripts/btlib/sfap.py +118 -2
- package/skills/agentforce-offline-experimentation-run/scripts/build_report.py +2 -2
- package/skills/agentforce-offline-experimentation-run/scripts/resolve-token.sh +9 -2
- package/skills/agentforce-offline-experimentation-run/scripts/sfap_replay.py +12 -1
- package/skills/commerce-react-storefront-create/SKILL.md +54 -21
- package/skills/data360-code-extension-generate/SKILL.md +160 -252
- package/skills/data360-code-extension-generate/references/README.md +34 -172
- package/skills/data360-code-extension-generate/references/environment-setup.md +198 -0
- package/skills/data360-code-extension-generate/references/mcp-integration.md +36 -0
- package/skills/data360-code-extension-generate/references/quick-reference.md +132 -202
- package/skills/data360-code-extension-generate/references/run-logs.md +31 -0
- package/skills/data360-code-extension-generate/references/schema-discovery.md +45 -0
- package/skills/data360-code-extension-generate/references/troubleshooting.md +45 -0
- package/skills/data360-code-extension-generate/scripts/check_env.sh +197 -0
- package/skills/data360-code-extension-generate/scripts/venv_hook.sh +22 -0
- package/skills/dx-devops-work-item-manage/SKILL.md +24 -8
- package/skills/dx-devops-work-item-manage/examples/common-workflows.md +32 -0
- package/skills/dx-devops-work-item-manage/references/review-api.md +95 -0
- package/skills/dx-lifecycle-center/SKILL.md +24 -18
- package/skills/dx-lifecycle-center/examples/workflows.md +57 -34
- package/skills/dx-lifecycle-center/references/connect-api.md +33 -4
- package/skills/dx-lifecycle-center/references/connect-org.md +59 -28
- 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-manage/SKILL.md +12 -12
- package/skills/dx-org-manage/examples/scratch-orgs/display_output.json +1 -3
- package/skills/dx-org-manage/examples/scratch-orgs/success_shape.json +1 -3
- package/skills/dx-org-manage/references/opening-org.md +1 -1
- package/skills/dx-org-manage/references/scratch-org-operations.md +15 -20
- 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 +3 -4
- package/skills/dx-packaging-move-to-2gp-migrate/references/api-operations.md +10 -7
- 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/education-cloud-academic-calendar-generate/SKILL.md +2 -2
- package/skills/education-cloud-course-catalog-migrate/SKILL.md +1 -1
- package/skills/education-cloud-domain-configure/references/domain-features/recruitment-admissions.md +8 -7
- package/skills/education-cloud-multi-campus-configure/SKILL.md +1 -0
- package/skills/education-cloud-multi-campus-configure/references/error_handling.md +7 -6
- package/skills/education-cloud-student-recruitment-agent-configure/SKILL.md +2 -0
- package/skills/education-cloud-student-recruitment-agent-configure/references/customer-narration.md +2 -0
- package/skills/education-cloud-student-recruitment-agent-configure/references/flows.md +1 -1
- package/skills/education-cloud-student-recruitment-agent-configure/references/grounding.md +5 -4
- package/skills/education-cloud-student-recruitment-agent-configure/references/permissions.md +1 -1
- package/skills/education-cloud-student-recruitment-agent-configure/references/prerequisites.md +1 -1
- package/skills/education-cloud-student-recruitment-agent-configure/references/routing.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 +8 -7
- package/skills/experience-cms-content-type-generate/references/agent-checklist.md +3 -3
- package/skills/experience-cms-content-type-generate/references/anti-patterns.md +2 -2
- package/skills/experience-cms-content-type-generate/references/discovery-details.md +1 -1
- package/skills/experience-cms-content-type-generate/references/retrieve-and-reconcile.md +5 -9
- package/skills/experience-ui-bundle-custom-app-generate/scripts/resolve-uibundle-path.mjs +10 -0
- package/skills/field-service-data-capture-migrate/references/converter-builder-contract.md +2 -2
- package/skills/field-service-data-capture-migrate/references/fsm-dc-capability-catalog.md +2 -2
- package/skills/field-service-data-capture-migrate/scripts/analyze_flow.py +1 -1
- package/skills/field-service-data-capture-migrate/scripts/convert_to_dc_spec.py +1 -1
- package/skills/field-service-data-capture-migrate/scripts/fsm_dc_catalog.py +2 -2
- package/skills/field-service-data-capture-migrate/scripts/generate_summary.py +2 -2
- 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-custom-application-generate/SKILL.md +97 -104
- package/skills/platform-custom-application-generate/references/app-properties.md +52 -0
- package/skills/platform-custom-application-generate/references/app-visibility.md +19 -0
- package/skills/platform-custom-application-generate/references/utility-bar.md +55 -0
- 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 +1 -1
- package/skills/platform-datamask-run/references/policy-authoring.md +41 -18
- package/skills/platform-dataspace-access-configure/SKILL.md +25 -10
- package/skills/platform-dsar-policy-manage/SKILL.md +7 -6
- package/skills/platform-dsar-policy-manage/references/export-and-history.md +10 -8
- package/skills/platform-dsar-policy-manage/references/report-format.md +4 -2
- 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-grounding-get/SKILL.md +7 -7
- package/skills/platform-policy-rule-generate/SKILL.md +9 -7
- package/skills/platform-policy-rule-generate/references/condition-model.md +3 -3
- package/skills/platform-policy-rule-generate/references/conjunction-expression.md +9 -1
- package/skills/platform-policy-rule-generate/references/consumer-datacloud-ui.md +9 -1
- package/skills/platform-policy-rule-generate/references/examples/ExistsJoinRLS/policyRuleDefinitionSets/ExistsJoinRLS.policyRuleDefinitionSet +1 -2
- package/skills/platform-policy-rule-generate/references/examples/FieldReadDeny/policyRuleDefinitionSets/FieldReadDeny.policyRuleDefinitionSet +1 -2
- package/skills/platform-policy-rule-generate/references/examples/LastCharactersFieldMasking/policyRuleDefinitionSets/LastCharactersFieldMasking.policyRuleDefinitionSet +1 -2
- package/skills/platform-policy-rule-generate/references/examples/PrincipalFieldMatchRLS/policyRuleDefinitionSets/PrincipalFieldMatchRLS.policyRuleDefinitionSet +1 -2
- package/skills/platform-policy-rule-generate/references/examples/TaggedObjectAccess/policyRuleDefinitionSets/TaggedObjectAccess.policyRuleDefinitionSet +1 -0
- package/skills/platform-policy-rule-generate/references/headless-transport.md +2 -2
- package/skills/platform-policy-rule-generate/references/policy-schema-full.md +1 -1
- package/skills/platform-policy-rule-generate/references/policy-shapes.md +33 -0
- package/skills/platform-policy-rule-generate/references/templates-advanced.md +1 -1
- package/skills/platform-policy-rule-generate/references/ui-compatibility.md +5 -5
- package/skills/platform-report-generate/SKILL.md +29 -8
- package/skills/platform-report-generate/references/column-names.md +12 -1
- 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 +12 -0
- package/skills/platform-sharing-rules-generate/SKILL.md +12 -3
- package/skills/platform-sharing-rules-generate/references/rule-types.md +1 -0
- package/skills/service-agentforce-channel-configure/SKILL.md +6 -3
- package/skills/service-agentforce-channel-configure/references/agent-wiring.md +5 -3
- package/skills/service-agentforce-channel-configure/references/channel-branch-email.md +24 -15
- package/skills/service-agentforce-channel-configure/references/input-validation.md +23 -0
- package/skills/service-agentforce-channel-configure/references/live-traffic-gate.md +13 -7
- package/skills/service-agentforce-channel-configure/references/queue-resolution.md +3 -1
- package/skills/service-agentforce-human-escalation-configure/references/_vendored/input-validation.md +23 -0
- package/skills/service-agentforce-human-escalation-configure/references/_vendored/queue-resolution.md +146 -0
- package/skills/service-agentforce-human-escalation-configure/references/escalation-mechanism.md +1 -1
- package/skills/service-agentforce-human-escalation-configure/scripts/tests/_bootstrap.py +42 -11
- package/skills/service-agentforce-human-escalation-configure/scripts/tests/test_escalation_contracts.py +45 -0
- package/skills/service-agentforce-human-escalation-configure/scripts/verify-and-configure.sh +23 -9
- package/skills/service-de-channel-activate/SKILL.md +10 -10
- package/skills/service-de-channel-activate/references/gotchas.md +4 -4
- package/skills/service-de-channel-activate/references/phone-verification.md +43 -19
- package/skills/service-de-channel-create/SKILL.md +1 -1
- package/skills/service-de-channel-create/references/facebook.md +1 -1
- package/skills/service-de-channel-create/references/whatsapp.md +33 -6
- package/skills/service-de-channel-routing-configure/SKILL.md +5 -1
- package/skills/service-de-channel-routing-configure/references/gotchas.md +3 -1
- package/skills/service-de-channel-routing-configure/references/named-queue.md +39 -0
- package/skills/service-de-channel-settings-configure/SKILL.md +3 -1
- package/skills/service-de-channel-settings-configure/references/channel-settings-facets.md +2 -2
- package/skills/service-de-channel-settings-configure/references/gotchas.md +12 -1
- package/skills/service-de-headless-channel-configure/SKILL.md +68 -74
- package/skills/service-de-headless-channel-configure/references/gotchas.md +6 -2
- package/skills/service-de-headless-channel-configure/references/inputs.md +19 -0
- package/skills/service-de-headless-channel-configure/references/output-envelopes.md +23 -1
- package/skills/service-de-headless-channel-configure/references/partial-success.md +1 -0
- package/skills/service-de-headless-channel-configure/references/requested-settings.md +55 -0
- package/skills/service-de-headless-channel-configure/references/worked-examples.md +35 -1
- package/skills/service-digital-engagement-channel-configure/SKILL.md +45 -108
- package/skills/service-digital-engagement-channel-configure/assets/messaging_channel_template.xml +2 -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 +18 -14
- package/skills/service-digital-engagement-channel-configure/references/onboarding_contract.md +17 -21
- 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-digital-engagement-deployment-configure/SKILL.md +2 -2
- package/skills/service-digital-engagement-deployment-configure/references/onboarding_contract.md +4 -2
- package/skills/service-digital-engagement-deployment-configure/scripts/check-api-version.sh +1 -1
- 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/service-omni-command-center-configure/SKILL.md +1 -1
- package/skills/agentforce-bot-upgrade/references/planner-workflow-reference.md +0 -78
- package/skills/data360-schema-get/SKILL.md +0 -388
- package/skills/data360-schema-get/references/README.md +0 -191
- package/skills/data360-schema-get/scripts/get_dlo_schema.py +0 -244
- package/skills/data360-schema-get/scripts/get_dmo_schema.py +0 -233
- package/skills/dx-lifecycle-center/assets/widgets/connect-connected/connect-connected.json +0 -65
- package/skills/dx-lifecycle-center/assets/widgets/connect-connected/schema.json +0 -32
- package/skills/dx-lifecycle-center/assets/widgets/connect-sign-in/connect-sign-in.json +0 -57
- package/skills/dx-lifecycle-center/assets/widgets/connect-sign-in/schema.json +0 -21
- package/skills/dx-lifecycle-center/scripts/card-policy.jq +0 -71
- package/skills/dx-lifecycle-center/scripts/fill-widget.jq +0 -29
- package/skills/dx-lifecycle-center/scripts/widget.sh +0 -28
- 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
- package/skills/field-service-prework-brief-deployer-configure/SKILL.md +0 -646
- package/skills/field-service-voice-to-form-configure/SKILL.md +0 -650
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Scan a source tree for MCP-tool-able backing types and report how each would
|
|
3
|
+
// bind (apiSource / apiIdentifier) and how it becomes available.
|
|
4
|
+
//
|
|
5
|
+
// Covers:
|
|
6
|
+
// - Apex @InvocableMethod (class, method, types, and fields global) -> aa:apex-<Class>
|
|
7
|
+
// - Autolaunched Flow (input AND output <variables>) -> fa:flow-<Flow>
|
|
8
|
+
// Usage: node scan_tool_candidates.mjs [SOURCE_ROOT]
|
|
9
|
+
import fs from "node:fs";
|
|
10
|
+
import path from "node:path";
|
|
11
|
+
|
|
12
|
+
function fail(msg) {
|
|
13
|
+
process.stderr.write(msg + "\n");
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const args = process.argv.slice(2);
|
|
18
|
+
if (args.length > 1) {
|
|
19
|
+
fail("Usage: scan_tool_candidates.mjs [source-root]");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let scanRoot = args[0] ?? process.cwd();
|
|
23
|
+
if (!fs.existsSync(scanRoot) || !fs.statSync(scanRoot).isDirectory()) {
|
|
24
|
+
process.stderr.write(`ERROR: source root does not exist: ${scanRoot}\n`);
|
|
25
|
+
process.exit(1);
|
|
26
|
+
}
|
|
27
|
+
scanRoot = fs.realpathSync(scanRoot);
|
|
28
|
+
|
|
29
|
+
function* walk(dir) {
|
|
30
|
+
let entries;
|
|
31
|
+
try {
|
|
32
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
33
|
+
} catch {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
for (const e of entries) {
|
|
37
|
+
const full = path.join(dir, e.name);
|
|
38
|
+
if (e.isDirectory()) {
|
|
39
|
+
yield* walk(full);
|
|
40
|
+
} else if (e.isFile()) {
|
|
41
|
+
yield full;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function stripComments(src) {
|
|
47
|
+
return src.replace(/\/\*[\s\S]*?\*\//g, " ").replace(/\/\/[^\n]*/g, " ");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function annotationBodyEnd(rest) {
|
|
51
|
+
if (!/^\s*\(/.test(rest)) return 0;
|
|
52
|
+
let depth = 0;
|
|
53
|
+
let k = rest.indexOf("(");
|
|
54
|
+
for (; k < rest.length; k++) {
|
|
55
|
+
if (rest[k] === "(") depth++;
|
|
56
|
+
else if (rest[k] === ")") {
|
|
57
|
+
depth--;
|
|
58
|
+
if (depth === 0) return k + 1;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return rest.length;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const APEX_PRIMITIVE_TYPES = new Set([
|
|
65
|
+
"blob",
|
|
66
|
+
"boolean",
|
|
67
|
+
"date",
|
|
68
|
+
"datetime",
|
|
69
|
+
"decimal",
|
|
70
|
+
"double",
|
|
71
|
+
"id",
|
|
72
|
+
"integer",
|
|
73
|
+
"long",
|
|
74
|
+
"string",
|
|
75
|
+
"time",
|
|
76
|
+
]);
|
|
77
|
+
|
|
78
|
+
function globalClassBody(src, className) {
|
|
79
|
+
const header = new RegExp(
|
|
80
|
+
`global(?:\\s+(?:with|without|inherited)\\s+sharing)?\\s+class\\s+${className}\\b[^\\{]*\\{`,
|
|
81
|
+
).exec(src);
|
|
82
|
+
if (!header) return null;
|
|
83
|
+
|
|
84
|
+
const open = header.index + header[0].lastIndexOf("{");
|
|
85
|
+
let depth = 0;
|
|
86
|
+
for (let i = open; i < src.length; i++) {
|
|
87
|
+
if (src[i] === "{") depth++;
|
|
88
|
+
else if (src[i] === "}") {
|
|
89
|
+
depth--;
|
|
90
|
+
if (depth === 0) return src.slice(open + 1, i);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function hasOnlyGlobalInvocableFields(typeBody) {
|
|
97
|
+
const annotations = [...typeBody.matchAll(/@InvocableVariable\b/g)];
|
|
98
|
+
if (annotations.length === 0) return false;
|
|
99
|
+
return annotations.every((annotation) => {
|
|
100
|
+
const rest = typeBody.slice(annotation.index + annotation[0].length);
|
|
101
|
+
const declaration = rest.slice(annotationBodyEnd(rest));
|
|
102
|
+
return /^\s*global\b/.test(declaration);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function isSupportedListType(src, typeName) {
|
|
107
|
+
if (APEX_PRIMITIVE_TYPES.has(typeName.toLowerCase())) return true;
|
|
108
|
+
const typeBody = globalClassBody(src, typeName);
|
|
109
|
+
return typeBody !== null && hasOnlyGlobalInvocableFields(typeBody);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Eligibility matches the invocable contract the skill serves: the outer class
|
|
113
|
+
// and method must be global. Custom List types and all their exposed fields must
|
|
114
|
+
// also be global; supported Apex primitive List types need no wrapper class.
|
|
115
|
+
function invocableEligibility(src, className) {
|
|
116
|
+
const stripped = stripComments(src);
|
|
117
|
+
if (!stripped.includes("@InvocableMethod")) return null;
|
|
118
|
+
const globalClass = new RegExp(
|
|
119
|
+
`global(?:\\s+(?:with|without|inherited)\\s+sharing)?\\s+class\\s+${className}\\b`,
|
|
120
|
+
).test(stripped);
|
|
121
|
+
if (!globalClass) return "containing class must be global";
|
|
122
|
+
|
|
123
|
+
const re = /@InvocableMethod\b/g;
|
|
124
|
+
let found = false;
|
|
125
|
+
let m;
|
|
126
|
+
while ((m = re.exec(stripped)) !== null) {
|
|
127
|
+
found = true;
|
|
128
|
+
const rest = stripped.slice(m.index + m[0].length);
|
|
129
|
+
const decl = rest.slice(annotationBodyEnd(rest));
|
|
130
|
+
const sig = decl.split("(")[0];
|
|
131
|
+
const params = decl.slice(sig.length + 1);
|
|
132
|
+
if (!/\bglobal\b/.test(sig)) continue;
|
|
133
|
+
const resultMatch = sig.match(/List\s*<\s*([A-Za-z][A-Za-z0-9_]*)\s*>/);
|
|
134
|
+
const requestMatch = params.match(/List\s*<\s*([A-Za-z][A-Za-z0-9_]*)\s*>/);
|
|
135
|
+
if (!resultMatch || !requestMatch) {
|
|
136
|
+
return "global @InvocableMethod must take and return List types";
|
|
137
|
+
}
|
|
138
|
+
const typesOk = [requestMatch[1], resultMatch[1]].every((typeName) =>
|
|
139
|
+
isSupportedListType(stripped, typeName),
|
|
140
|
+
);
|
|
141
|
+
if (typesOk) return "";
|
|
142
|
+
return "custom request and result types and every @InvocableVariable field must be global";
|
|
143
|
+
}
|
|
144
|
+
return found ? "@InvocableMethod method must be global" : null;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function flowVariableBlocks(src) {
|
|
148
|
+
return [...src.matchAll(/<variables\b[^>]*>[\s\S]*?<\/variables>/g)].map((match) =>
|
|
149
|
+
match[0].replace(/<description>[\s\S]*?<\/description>/g, ""),
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function variableFlag(blocks, flag) {
|
|
154
|
+
const re = new RegExp(`<${flag}>\\s*true\\s*</${flag}>`);
|
|
155
|
+
return blocks.some((block) => re.test(block));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
console.log("Candidate | Type | apiSource | apiIdentifier | Availability");
|
|
159
|
+
console.log("--------- | ---- | --------- | ------------- | ------------");
|
|
160
|
+
|
|
161
|
+
// --- Apex classes: full global invocable contract ---
|
|
162
|
+
for (const f of walk(scanRoot)) {
|
|
163
|
+
if (!f.endsWith(".cls")) continue;
|
|
164
|
+
const className = path.basename(f, ".cls");
|
|
165
|
+
const src = fs.readFileSync(f, "utf-8");
|
|
166
|
+
const reason = invocableEligibility(src, className);
|
|
167
|
+
if (reason === null) continue;
|
|
168
|
+
if (reason === "") {
|
|
169
|
+
console.log(`${className} | Apex @InvocableMethod | API_CATALOG | aa:apex-${className} | eligible (global)`);
|
|
170
|
+
} else {
|
|
171
|
+
console.log(`${className} | Apex @InvocableMethod | — | — | SKIP — ${reason}`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// --- Flows: autolaunched only, and only with <variables> that are input and output ---
|
|
176
|
+
for (const f of walk(scanRoot)) {
|
|
177
|
+
if (!f.endsWith(".flow-meta.xml")) continue;
|
|
178
|
+
const flowName = path.basename(f, ".flow-meta.xml");
|
|
179
|
+
const src = fs.readFileSync(f, "utf-8");
|
|
180
|
+
if (!/<processType>\s*AutoLaunchedFlow\s*<\/processType>/.test(src)) {
|
|
181
|
+
console.log(`${flowName} | Flow (NOT autolaunched) | — | — | SKIP — only autolaunched flows are MCP-able`);
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
const blocks = flowVariableBlocks(src);
|
|
185
|
+
if (variableFlag(blocks, "isInput") && variableFlag(blocks, "isOutput")) {
|
|
186
|
+
console.log(`${flowName} | Autolaunched Flow | API_CATALOG | fa:flow-${flowName} | eligible`);
|
|
187
|
+
} else {
|
|
188
|
+
console.log(`${flowName} | Autolaunched Flow | — | — | SKIP — needs both input and output variables`);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
console.log();
|
|
193
|
+
console.log("Notes:");
|
|
194
|
+
console.log(" - This scan reports global invocable Apex actions with supported primitive or fully global custom types, plus autolaunched Flows with input and output variables.");
|
|
195
|
+
console.log(" - Confirm add-or-skip per candidate before adding its <tools> block.");
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const BLOCKED_SCHEMES = new Set(["javascript", "data", "file", "blob", "vbscript"]);
|
|
2
|
+
|
|
3
|
+
function loopbackHost(hostname) {
|
|
4
|
+
const host = hostname.replace(/^\[|\]$/g, "");
|
|
5
|
+
return host === "localhost" || host === "127.0.0.1" || host === "::1";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// OAuth redirect URIs are absolute. https is the normal case; http is only
|
|
9
|
+
// loopback; native clients may use a custom scheme with a host. Wildcards,
|
|
10
|
+
// fragments, and userinfo are not redirect URIs.
|
|
11
|
+
export function callbackRejection(raw) {
|
|
12
|
+
if (typeof raw !== "string" || !raw.trim()) return "callback URL is empty";
|
|
13
|
+
const value = raw.trim();
|
|
14
|
+
if (value.includes("*") || value.includes("#") || /\s/.test(value)) {
|
|
15
|
+
return "callback URL must be an absolute redirect URI without wildcards, fragments, or whitespace";
|
|
16
|
+
}
|
|
17
|
+
let url;
|
|
18
|
+
try {
|
|
19
|
+
url = new URL(value);
|
|
20
|
+
} catch {
|
|
21
|
+
return "callback URL must be an absolute URI";
|
|
22
|
+
}
|
|
23
|
+
if (url.username || url.password) return "callback URL must not include userinfo";
|
|
24
|
+
const scheme = url.protocol.slice(0, -1).toLowerCase();
|
|
25
|
+
if (BLOCKED_SCHEMES.has(scheme)) return `callback scheme '${scheme}' is not allowed`;
|
|
26
|
+
if (scheme === "https") {
|
|
27
|
+
return url.hostname ? "" : "https callback URL needs a host";
|
|
28
|
+
}
|
|
29
|
+
if (scheme === "http") {
|
|
30
|
+
return loopbackHost(url.hostname) ? "" : "http callbacks are limited to loopback hosts";
|
|
31
|
+
}
|
|
32
|
+
if (!/^[a-z][a-z0-9+.-]*$/.test(scheme) || !url.hostname) {
|
|
33
|
+
return "custom-scheme callbacks need a scheme and a host";
|
|
34
|
+
}
|
|
35
|
+
return "";
|
|
36
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// DeveloperName values are interpolated into SOQL and filenames.
|
|
2
|
+
// Allow one managed-package separator (ns__Name). Reject a second double
|
|
3
|
+
// underscore, a trailing underscore, and anything over 80 characters.
|
|
4
|
+
const DEVELOPER_NAME =
|
|
5
|
+
/^(?:[A-Za-z][A-Za-z0-9]{0,14}__)?[A-Za-z][A-Za-z0-9]*(?:_[A-Za-z0-9]+)*$/;
|
|
6
|
+
|
|
7
|
+
export function isValidDeveloperName(name) {
|
|
8
|
+
return typeof name === "string" && name.length > 0 && name.length <= 80 && DEVELOPER_NAME.test(name);
|
|
9
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { isValidDeveloperName } from "./developer_name.mjs";
|
|
4
|
+
|
|
5
|
+
const METADATA_NAMESPACE = "http://soap.sforce.com/2006/04/metadata";
|
|
6
|
+
|
|
7
|
+
function decode(text) {
|
|
8
|
+
if (/&(?!(?:amp|lt|gt|quot|apos|#\d+|#x[\da-fA-F]+);)/.test(text)) throw new Error("Invalid entity");
|
|
9
|
+
return text.replace(/&(amp|lt|gt|quot|apos|#\d+|#x[\da-fA-F]+);/g, (_, entity) => {
|
|
10
|
+
if (!entity.startsWith("#")) return { amp: "&", lt: "<", gt: ">", quot: '"', apos: "'" }[entity];
|
|
11
|
+
const point = entity.startsWith("#x") ? parseInt(entity.slice(2), 16) : Number(entity.slice(1));
|
|
12
|
+
if (![9, 10, 13].includes(point) && !(point >= 0x20 && point <= 0xD7FF) &&
|
|
13
|
+
!(point >= 0xE000 && point <= 0xFFFD) && !(point >= 0x10000 && point <= 0x10FFFF)) {
|
|
14
|
+
throw new Error("Invalid XML character");
|
|
15
|
+
}
|
|
16
|
+
return String.fromCodePoint(point);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// ECA templates have a single metadata root and scalar child fields. Reject
|
|
21
|
+
// unsupported XML rather than guessing field values or resolving entities.
|
|
22
|
+
function fields(xml) {
|
|
23
|
+
if (/<!DOCTYPE|<!ENTITY/i.test(xml)) throw new Error("Unsupported declarations");
|
|
24
|
+
if (/[\u0000-\u0008\u000B\u000C\u000E-\u001F\uFFFE\uFFFF]/.test(xml)) throw new Error("Invalid XML character");
|
|
25
|
+
let text = xml.replace(/^\uFEFF/, "").replace(/\r\n?/g, "\n").trim();
|
|
26
|
+
text = text.replace(/^<\?xml\s[^?]*\?>\s*/, "")
|
|
27
|
+
.replace(/<!\[CDATA\[[\s\S]*?\]\]>|<!--(?:[^-]|-(?!-))*-->/g,
|
|
28
|
+
(part) => part.startsWith("<!--") ? "" : part).trim();
|
|
29
|
+
const open = text.match(/^<([A-Za-z_][\w.-]*)([^<>]*?)(\/?)>/);
|
|
30
|
+
if (!open) throw new Error("Invalid root");
|
|
31
|
+
const attributes = new Map();
|
|
32
|
+
const attribute = /\s+([A-Za-z_][\w:.-]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/y;
|
|
33
|
+
let offset = 0;
|
|
34
|
+
while (open[2].slice(offset).trim()) {
|
|
35
|
+
attribute.lastIndex = offset;
|
|
36
|
+
const match = attribute.exec(open[2]);
|
|
37
|
+
if (!match || attributes.has(match[1]) || !/^xmlns(?::[\w.-]+)?$/.test(match[1])) throw new Error("Unsupported root attributes");
|
|
38
|
+
attributes.set(match[1], decode(match[2] ?? match[3]));
|
|
39
|
+
offset = attribute.lastIndex;
|
|
40
|
+
}
|
|
41
|
+
if (attributes.get("xmlns") !== METADATA_NAMESPACE) throw new Error("Invalid namespace");
|
|
42
|
+
let body = text.slice(open[0].length);
|
|
43
|
+
if (open[3]) {
|
|
44
|
+
if (body.trim()) throw new Error("Trailing XML");
|
|
45
|
+
} else {
|
|
46
|
+
const close = body.slice(body.lastIndexOf("</")).match(/^<\/([A-Za-z_][\w.-]*)\s*>$/);
|
|
47
|
+
if (!close || close[1] !== open[1]) throw new Error("Invalid closing root");
|
|
48
|
+
body = body.slice(0, body.lastIndexOf("</"));
|
|
49
|
+
}
|
|
50
|
+
const result = new Map();
|
|
51
|
+
const field = /\s*<([A-Za-z_][\w.-]*)\s*(?:\/>|>([\s\S]*?)<\/\1\s*>)/y;
|
|
52
|
+
offset = 0;
|
|
53
|
+
while (body.slice(offset).trim()) {
|
|
54
|
+
field.lastIndex = offset;
|
|
55
|
+
const match = field.exec(body);
|
|
56
|
+
if (!match || result.has(match[1])) throw new Error("Invalid or duplicate field");
|
|
57
|
+
let value = "";
|
|
58
|
+
for (const part of (match[2] ?? "").split(/(<!\[CDATA\[[\s\S]*?\]\]>)/)) {
|
|
59
|
+
if (part.startsWith("<![CDATA[")) value += part.slice(9, -3);
|
|
60
|
+
else {
|
|
61
|
+
if (part.includes("<") || part.includes("]]>")) throw new Error("Invalid scalar field");
|
|
62
|
+
value += decode(part);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
result.set(match[1], value.trim());
|
|
66
|
+
offset = field.lastIndex;
|
|
67
|
+
}
|
|
68
|
+
return { root: open[1], values: result };
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function componentFile(dest, baseline) {
|
|
72
|
+
if (!baseline.values.has("externalClientApplication")) return dest;
|
|
73
|
+
const folder = path.dirname(dest);
|
|
74
|
+
const suffix = path.basename(dest).match(/\.eca[A-Za-z]*-meta\.xml$/)?.[0];
|
|
75
|
+
if (!suffix) throw new Error("Unknown component suffix");
|
|
76
|
+
let names;
|
|
77
|
+
try {
|
|
78
|
+
names = fs.readdirSync(folder).filter((name) => name.endsWith(suffix));
|
|
79
|
+
} catch (error) {
|
|
80
|
+
if (error.code === "ENOENT") return dest;
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
83
|
+
const owned = [];
|
|
84
|
+
for (const name of names) {
|
|
85
|
+
const candidate = path.join(folder, name);
|
|
86
|
+
if (!fs.lstatSync(candidate).isFile()) throw new Error("Ambiguous component file");
|
|
87
|
+
const parsed = fields(fs.readFileSync(candidate, "utf8"));
|
|
88
|
+
if (parsed.root !== baseline.root) throw new Error("Wrong metadata type");
|
|
89
|
+
if (!isValidDeveloperName(parsed.values.get("externalClientApplication"))) {
|
|
90
|
+
const error = new Error("Unresolved parent reference");
|
|
91
|
+
error.file = candidate;
|
|
92
|
+
error.missingParent = !parsed.values.has("externalClientApplication");
|
|
93
|
+
throw error;
|
|
94
|
+
}
|
|
95
|
+
if (parsed.values.get("externalClientApplication") === baseline.values.get("externalClientApplication")) owned.push(candidate);
|
|
96
|
+
}
|
|
97
|
+
if (owned.length > 1) throw new Error("Multiple associated components");
|
|
98
|
+
return owned[0] ?? dest;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function literalExpectedValues(templateFields, names) {
|
|
102
|
+
return Object.fromEntries(names.filter((name) => !/__ECA_[A-Z_]+__/.test(templateFields.get(name)))
|
|
103
|
+
.sort().map((name) => [name, templateFields.get(name)]));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function checkEcaPlan(plan) {
|
|
107
|
+
const files = plan.map(({ src, dest, template, expected }) => {
|
|
108
|
+
const report = { file: dest, template: src, status: "unknown", missingFields: [], differentFields: [], unverifiedFields: [], expectedValues: {} };
|
|
109
|
+
try {
|
|
110
|
+
const templateFields = fields(template).values;
|
|
111
|
+
const baseline = fields(expected);
|
|
112
|
+
report.file = componentFile(dest, baseline);
|
|
113
|
+
const entry = fs.lstatSync(report.file, { throwIfNoEntry: false });
|
|
114
|
+
if (!entry) {
|
|
115
|
+
report.status = "missing";
|
|
116
|
+
report.missingFields = [...baseline.values.keys()].sort();
|
|
117
|
+
report.expectedValues = literalExpectedValues(templateFields, report.missingFields);
|
|
118
|
+
return report;
|
|
119
|
+
}
|
|
120
|
+
if (!entry.isFile()) throw new Error("Not a regular file");
|
|
121
|
+
const actual = fields(fs.readFileSync(report.file, "utf8"));
|
|
122
|
+
if (actual.root !== baseline.root) throw new Error("Wrong metadata type");
|
|
123
|
+
for (const [name, value] of baseline.values) {
|
|
124
|
+
if (!actual.values.has(name)) report.missingFields.push(name);
|
|
125
|
+
else if (/__ECA_[A-Z_]+__/.test(value)) report.unverifiedFields.push(name);
|
|
126
|
+
else if (actual.values.get(name) !== value) report.differentFields.push(name);
|
|
127
|
+
}
|
|
128
|
+
for (const key of ["missingFields", "differentFields", "unverifiedFields"]) report[key].sort();
|
|
129
|
+
report.expectedValues = literalExpectedValues(templateFields, [...report.missingFields, ...report.differentFields]);
|
|
130
|
+
report.status = report.missingFields.length || report.differentFields.length
|
|
131
|
+
? "different" : report.unverifiedFields.length ? "unverified" : "match";
|
|
132
|
+
} catch (error) {
|
|
133
|
+
if (error.file) {
|
|
134
|
+
report.file = error.file;
|
|
135
|
+
report[error.missingParent ? "missingFields" : "unverifiedFields"] = ["externalClientApplication"];
|
|
136
|
+
}
|
|
137
|
+
report.reason = "Unreadable, malformed, duplicate-field, ambiguously associated, or unsupported scalar metadata XML; no absence or repair is inferred.";
|
|
138
|
+
}
|
|
139
|
+
return report;
|
|
140
|
+
});
|
|
141
|
+
const statuses = files.map((file) => file.status);
|
|
142
|
+
const comparisonStatus = statuses.includes("unknown") ? "unknown"
|
|
143
|
+
: statuses.some((status) => status === "different" || status === "missing") ? "different"
|
|
144
|
+
: statuses.includes("unverified") ? "unverified" : "match";
|
|
145
|
+
return {
|
|
146
|
+
comparisonStatus, files,
|
|
147
|
+
scope: "Read-only comparison of template-defined scalar ECA fields, not deployment or access validation. expectedValues contains literal template values for missing or different fields; actual and input-derived values are omitted.",
|
|
148
|
+
nextActions: [
|
|
149
|
+
"Review missing files/fields and differentFields using expectedValues and confirmed inputs; expected values are template baselines, not platform defaults or authorization to write.",
|
|
150
|
+
"For unverifiedFields, recover confirmed label, description, contact and callbacks; rerun the normal render command with the same inputs plus --check. Never infer approval from existing values.",
|
|
151
|
+
"Compare only template-defined fields and leave other fields unchanged. Preserve intentional overrides; use references/eca-fields.md for ownership and editing invariants, show the diff and follow Phase 2 confirmation rules before changes.",
|
|
152
|
+
"For missing files, use the named template and confirmed renderer inputs to create only that component. Never delete existing files or bypass overwrite protection to rerender a partial set.",
|
|
153
|
+
"Resolve unknown files before repair. Exit 0 means comparison ran, not that all fields match or policies were reviewed; `comparisonStatus: unknown` means some files could not be checked.",
|
|
154
|
+
],
|
|
155
|
+
};
|
|
156
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
|
|
4
|
+
// Check the nearest existing destination parent before any planned writes.
|
|
5
|
+
export function requireProjectDestination(projectRoot, destination) {
|
|
6
|
+
let parent = path.dirname(destination);
|
|
7
|
+
while (!fs.lstatSync(parent, { throwIfNoEntry: false })) parent = path.dirname(parent);
|
|
8
|
+
const actualRoot = fs.realpathSync(projectRoot);
|
|
9
|
+
const actualParent = fs.realpathSync(parent);
|
|
10
|
+
if (actualParent !== actualRoot && !actualParent.startsWith(actualRoot + path.sep)) {
|
|
11
|
+
throw new Error("ABORT: metadata destination resolves outside the project root");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Read the deployed MCP server, bound tools, and activation state. Read-only.
|
|
3
|
+
//
|
|
4
|
+
// Usage: node verify_server.mjs <TARGET_ORG_ALIAS> <SERVER_DEVELOPER_NAME> [--json]
|
|
5
|
+
//
|
|
6
|
+
// --json : emit one JSON object instead of the human-readable table.
|
|
7
|
+
//
|
|
8
|
+
// Exit: 0 when verification ran; read `status` (ready | not_found | inactive | no_tools)
|
|
9
|
+
// and `ready`. 1 on connection, query, or argument error.
|
|
10
|
+
import fs from "node:fs";
|
|
11
|
+
import { execFileSync } from "node:child_process";
|
|
12
|
+
import { isValidDeveloperName } from "./utils/developer_name.mjs";
|
|
13
|
+
|
|
14
|
+
function fail(msg, code = 1) {
|
|
15
|
+
process.stderr.write(msg + "\n");
|
|
16
|
+
process.exit(code);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const [targetOrg, serverName, opt, extra] = process.argv.slice(2);
|
|
20
|
+
if (!targetOrg) fail("ABORT: target org alias required");
|
|
21
|
+
if (!serverName) fail("ABORT: McpServerDefinition DeveloperName required");
|
|
22
|
+
if (extra !== undefined) {
|
|
23
|
+
fail("ABORT: too many arguments — usage: verify_server.mjs <org> <ServerDevName> [--json]");
|
|
24
|
+
}
|
|
25
|
+
let asJson = false;
|
|
26
|
+
if (opt !== undefined) {
|
|
27
|
+
if (opt === "--json") asJson = true;
|
|
28
|
+
else fail(`ABORT: unknown option '${opt}' — the only supported option is --json.`);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// SERVER_NAME is embedded in SOQL.
|
|
32
|
+
if (!isValidDeveloperName(serverName)) {
|
|
33
|
+
fail(
|
|
34
|
+
`ABORT: invalid DeveloperName '${serverName}' — letters/digits/single underscores, optional namespace__ prefix, start with a letter, <= 80 chars.`,
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const V = JSON.parse(fs.readFileSync("sfdx-project.json", "utf-8")).sourceApiVersion;
|
|
39
|
+
const toolingPath = `/services/data/v${V}/tooling`;
|
|
40
|
+
|
|
41
|
+
function toolingQuery(soql) {
|
|
42
|
+
const encoded = encodeURIComponent(soql);
|
|
43
|
+
try {
|
|
44
|
+
return execFileSync(
|
|
45
|
+
"sf",
|
|
46
|
+
["api", "request", "rest", `${toolingPath}/query?q=${encoded}`, "--target-org", targetOrg, "--method", "GET"],
|
|
47
|
+
{ encoding: "utf-8" },
|
|
48
|
+
);
|
|
49
|
+
} catch {
|
|
50
|
+
fail("ABORT: authenticated Tooling query failed.");
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Fail on a malformed 200 rather than misreport an empty tree.
|
|
55
|
+
function requireRecords(jsonText, label) {
|
|
56
|
+
let parsed;
|
|
57
|
+
try {
|
|
58
|
+
parsed = JSON.parse(jsonText);
|
|
59
|
+
} catch {
|
|
60
|
+
parsed = null;
|
|
61
|
+
}
|
|
62
|
+
if (!parsed || !Array.isArray(parsed.records)) {
|
|
63
|
+
fail(`ABORT: malformed ${label} query response (no .records array).`);
|
|
64
|
+
}
|
|
65
|
+
return parsed;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const mcpJson = requireRecords(
|
|
69
|
+
toolingQuery(`SELECT Id,DeveloperName,MasterLabel FROM McpServerDefinition WHERE DeveloperName='${serverName}'`),
|
|
70
|
+
"McpServerDefinition",
|
|
71
|
+
);
|
|
72
|
+
const mcpId = mcpJson.records[0]?.Id ?? "";
|
|
73
|
+
if (!mcpId) {
|
|
74
|
+
if (asJson) {
|
|
75
|
+
console.log(JSON.stringify({ status: "not_found", ready: false, developerName: serverName }));
|
|
76
|
+
} else {
|
|
77
|
+
console.log(`NOT FOUND: no McpServerDefinition named '${serverName}' in ${targetOrg}.`);
|
|
78
|
+
}
|
|
79
|
+
process.exit(0);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const toolsJson = requireRecords(
|
|
83
|
+
toolingQuery(`SELECT ToolName,ToolTitle FROM McpServerToolDefinition WHERE McpServerId='${mcpId}'`),
|
|
84
|
+
"McpServerToolDefinition",
|
|
85
|
+
);
|
|
86
|
+
const accessJson = requireRecords(
|
|
87
|
+
toolingQuery(`SELECT Active FROM McpServerAccess WHERE McpServerId='${mcpId}'`),
|
|
88
|
+
"McpServerAccess",
|
|
89
|
+
);
|
|
90
|
+
const toolCount = toolsJson.records.length;
|
|
91
|
+
const active = String(accessJson.records[0]?.Active ?? "false");
|
|
92
|
+
const status = active !== "true" ? "inactive" : toolCount === 0 ? "no_tools" : "ready";
|
|
93
|
+
|
|
94
|
+
if (asJson) {
|
|
95
|
+
console.log(
|
|
96
|
+
JSON.stringify({
|
|
97
|
+
status,
|
|
98
|
+
ready: status === "ready",
|
|
99
|
+
mcpServerId: mcpId,
|
|
100
|
+
developerName: serverName,
|
|
101
|
+
active: active === "true",
|
|
102
|
+
toolCount,
|
|
103
|
+
tools: toolsJson.records.map((r) => ({ toolName: r.ToolName, toolTitle: r.ToolTitle })),
|
|
104
|
+
}),
|
|
105
|
+
);
|
|
106
|
+
} else {
|
|
107
|
+
console.log(`McpServerDefinition : ${serverName} (${mcpId})`);
|
|
108
|
+
console.log(`McpServerAccess.Active : ${active}`);
|
|
109
|
+
console.log(`Bound tools (${toolCount}):`);
|
|
110
|
+
for (const r of toolsJson.records) {
|
|
111
|
+
console.log(` - ${r.ToolName} [${r.ToolTitle ?? "-"}]`);
|
|
112
|
+
}
|
|
113
|
+
if (toolCount === 0) console.log(" (none — deploy created no tool rows)");
|
|
114
|
+
console.log(`Status : ${status}`);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Readiness (exists + active + at least one tool) is reported via `status`, not the exit code.
|
|
118
|
+
process.exit(0);
|
|
@@ -65,7 +65,8 @@ Every terminal state emits a structured outcome. The `message` field is printed
|
|
|
65
65
|
|
|
66
66
|
| `status` | `fqn` | `schema` | Meaning | Caller action |
|
|
67
67
|
|---|---|---|---|---|
|
|
68
|
-
| `success` | present | present |
|
|
68
|
+
| `success` | present | present | Custom/deployed type confirmed in the org (1e retrieve on a `c__*` type, or deploy on "Create new"). | Proceed (e.g. author content records). |
|
|
69
|
+
| `success` | present | `null` | OOTB type (`sfdc_cms__*`) resolved — namespace gate skips retrieval (schema platform-owned/immutable); FQN alone is authoritative. | Proceed — authoring is server-side, needs no schema. |
|
|
69
70
|
| `not_deployed` | present | `null` | Bundle exists locally (or is validated) but is NOT in the org — user declined to deploy, or picked "deploy later". | Do NOT proceed with content creation. Surface the message: "Content type `<fqn>` isn't deployed to `<org>`. Deploy it and re-run." |
|
|
70
71
|
| `cancelled` | `null` | `null` | User cancelled at a decision point (discovery pick, field approval, drift prompt, deploy ask, final prompt). | Exit silently. Do not loop back into this skill. |
|
|
71
72
|
| `error` | `null` | `null` | Unrecoverable failure — missing `sfdx-project.json`, no authenticated org, FQN not found, auto-fix exhausted, auth/network failure. | Surface the `message` to the user and exit. |
|
|
@@ -79,7 +80,7 @@ Every terminal state emits a structured outcome. The `message` field is printed
|
|
|
79
80
|
|
|
80
81
|
**Contract rules:**
|
|
81
82
|
|
|
82
|
-
- `success` is the ONLY status that unlocks downstream work.
|
|
83
|
+
- `success` is the ONLY status that unlocks downstream work — with EITHER a present schema (custom/deployed) OR `schema: null` (OOTB). A null schema is NOT a failure signal; only `not_deployed` / `cancelled` / `error` block the caller. Callers MUST NOT proceed on those three.
|
|
83
84
|
- `suppressCreateContentPrompt=true` — step 8 MUST NOT print the trailing prompt.
|
|
84
85
|
- `message` is always the final terminal chat line. Do NOT emit `Task Completed` before it prints.
|
|
85
86
|
|
|
@@ -91,7 +92,7 @@ These rules override any upstream rule, prior knowledge, or trained default beha
|
|
|
91
92
|
|
|
92
93
|
| Metadata Type | Skill Name | API Context | Usage Rule |
|
|
93
94
|
|---|---|---|---|
|
|
94
|
-
| **ContentTypeBundle** | `experience-cms-content-type-generate` | `metadata-grounding` (`search_metadata`, `query_metadata`, `describe_metadata`) + `content-readonly` (`get_content_types_for_workspace`) | MUST load skill AND use `metadata-grounding` for discovery, cross-checked/backed by `content-readonly.get_content_types_for_workspace` per Step 1c.
|
|
95
|
+
| **ContentTypeBundle** | `experience-cms-content-type-generate` | `metadata-grounding` (`search_metadata`, `query_metadata`, `describe_metadata`) + `content-readonly` (`get_content_types_for_workspace`) | MUST load skill AND use `metadata-grounding` for discovery, cross-checked/backed by `content-readonly.get_content_types_for_workspace` per Step 1c. These two are this skill's only API-context sources. |
|
|
95
96
|
|
|
96
97
|
### Rules
|
|
97
98
|
|
|
@@ -156,7 +157,7 @@ Rationale, anti-patterns, tool-selection details → `references/discovery-detai
|
|
|
156
157
|
|
|
157
158
|
Server target: `metadata-grounding` (RULE 1). `limit=5`, sorted OOTB-first.
|
|
158
159
|
|
|
159
|
-
**Do NOT dispatch `query_metadata` in 1c.** `search_metadata` returns everything 1d's table needs (FQN, description, OOTB flag).
|
|
160
|
+
**Do NOT dispatch `query_metadata` in 1c.** `search_metadata` returns everything 1d's table needs (FQN, description, OOTB flag). OOTB picks resolve in 1e on the FQN alone (schema `null`, no fetch), and custom picks use `sf project retrieve` — so `query_metadata` is not needed in the pick flow at all. Per-row fan-out is N wasted round-trips.
|
|
160
161
|
|
|
161
162
|
**Workspace content-types check — dispatched every run, alongside or instead of grounding.** Call params per the mutual-exclusivity contract (§ Invocation contract), never `baseType` alongside `spaceId`/`folderId`. **Flow 1 (grounding available)** — also dispatch `get_content_types_for_workspace`; org candidate set = **intersection** of both FQN sets (empty is valid, do not widen/retry). **Flow 2 (grounding unavailable)** — dispatch it directly as the sole org signal, apply step 1b's semantic matching to its rows, record `groundingFallback=workspaceTypes` for 1d's TRUTH GATE. Neither tool substitutes for 1e's retrieve. Call shapes, unavailability handling, rationale → `references/discovery-details.md#1c continued`.
|
|
162
163
|
|
|
@@ -204,8 +205,8 @@ Reached when 1d resolves to a match / provided FQN, OR when the caller invoked w
|
|
|
204
205
|
|
|
205
206
|
**Namespace gate:**
|
|
206
207
|
|
|
207
|
-
- **Custom FQN** (`c__*`, non-platform namespace) → run `sf project retrieve start --metadata ContentTypeBundle:<DeveloperName> --target-org <alias> --json`.
|
|
208
|
-
- **OOTB FQN** (`sfdc_cms__*`) → skip `sf project retrieve start
|
|
208
|
+
- **Custom FQN** (`c__*`, non-platform namespace) → **ALWAYS retrieve**: run `sf project retrieve start --metadata ContentTypeBundle:<DeveloperName> --target-org <alias> --json`. Namespace is the ONLY gate — discovery/workspace confirmation does NOT substitute for retrieve. There is no "OOTB-equivalent" custom type.
|
|
209
|
+
- **OOTB FQN** (`sfdc_cms__*`) → skip retrieval entirely: no `sf project retrieve start`, no `query_metadata`, no `describe_metadata`. The `sfdc_cms__*` schema is platform-owned and immutable, and no downstream step needs it (content authoring is server-side). This skip is gated on the `sfdc_cms__*` namespace ALONE, never on "it was discovered." Return `{ status: "success", fqn: "<fqn>", schema: null }` immediately — do NOT depend on `metadata-grounding` and do NOT fail on a grounding outage. **Never fabricate an OOTB schema from training data.** Full rule → `references/retrieve-and-reconcile.md` § Namespace gate.
|
|
209
210
|
|
|
210
211
|
**Reconciliation** — compare retrieved schema against `<sfdx-source>/contentTypes/<DeveloperName>/schema.json`. Full matrix + drift template + routing → `references/retrieve-and-reconcile.md`.
|
|
211
212
|
|
|
@@ -431,7 +432,7 @@ Full anti-pattern table (violation / rationalization / correct action) → `refe
|
|
|
431
432
|
|
|
432
433
|
- Folder name, `<masterLabel>`, and the bundle's `title` should be consistent (PascalCase folder, human-readable label and title).
|
|
433
434
|
- Avoid `lightning__fileType` and `lightning__contentReferenceType` — currently unsupported.
|
|
434
|
-
- Eval datasets live in `
|
|
435
|
+
- Eval datasets live in `eval/experience-cms-content-type-generate/`, not in `tests/evals/`.
|
|
435
436
|
|
|
436
437
|
## Reference file index
|
|
437
438
|
|
|
@@ -6,7 +6,7 @@ Copy this checklist agent-internally (do NOT print to chat). Tick each box only
|
|
|
6
6
|
|
|
7
7
|
- [ ] Step 1a: read `sfdx-project.json`, resolved `<sfdx-source>`
|
|
8
8
|
- [ ] Step 1b: ran directory-listing tool against `<sfdx-source>/contentTypes/`
|
|
9
|
-
- [ ] Step 1c: dispatched `metadata-grounding.search_metadata` (
|
|
9
|
+
- [ ] Step 1c: dispatched `metadata-grounding.search_metadata` (not a generic metadata schema lookup)
|
|
10
10
|
→ `query` string is 3-5 English content-domain nouns (`news article announcement story headline`, not `sfdc_cms__news content type` or `bundle`). Confirmed no `sfdc_cms`, `c__`, `__` substring, `content type`, `bundle`, `metadata`, or `cms` in the query. See `discovery-query-rules.md` § Concrete tool calls.
|
|
11
11
|
→ recorded `grounding=complete` OR `grounding=unavailable` from a REAL `metadata-grounding` attempt
|
|
12
12
|
→ ALSO dispatched `content-readonly.get_content_types_for_workspace` per the mutual-exclusivity contract: `{ spaceId }` alone if the caller supplied `spaceId` — no `baseType` sent; `{ folderId }` alone if the caller supplied `folderId` — no `baseType` sent; `{ baseType }` if the caller supplied only that (no scope); `{ baseType: "CONTENT" }` if the caller supplied none of the three. If `grounding=complete`: took the intersection of the two responses' FQNs (Flow 1). If `grounding=unavailable`: this tool's semantically-matched rows ARE the org signal (Flow 2) — recorded `groundingFallback=workspaceTypes`. Only skip this dispatch if `get_content_types_for_workspace` itself is absent from the deferred-tool list this turn (record `workspaceTypes=unavailable`).
|
|
@@ -27,7 +27,7 @@ Copy this checklist agent-internally (do NOT print to chat). Tick each box only
|
|
|
27
27
|
|
|
28
28
|
## Tripwires — stop and restart from step 1a
|
|
29
29
|
|
|
30
|
-
- About to dispatch a discovery tool to any server other than `metadata-grounding` or `content-readonly.get_content_types_for_workspace` — including
|
|
30
|
+
- About to dispatch a discovery tool to any server other than `metadata-grounding` or `content-readonly.get_content_types_for_workspace` — including generic metadata schema lookups, `salesforce-metadata-experts`, `execute_metadata_action`, `run_soql_query`, `run_tooling_query`, `sf data query`, `sf org list metadata`, or a SOQL `SELECT … FROM ContentTypeBundle` → **Rule 1 violation.** These two are the ONLY allowed discovery paths. `get_content_types_for_workspace` is a sanctioned complement to grounding (Flow 1 intersection) and its sanctioned Flow 2 replacement when grounding is down — it is NOT a loophole for reaching any other server. If `metadata-grounding` isn't in the deferred-tool list at turn start, accept `grounding=unavailable`, still dispatch `get_content_types_for_workspace` (Flow 2), and use the matching variant in step 1d — do NOT reach for any OTHER substitute.
|
|
31
31
|
- About to dispatch `metadata-grounding.search_metadata` with a `query` containing `sfdc_cms`, `c__`, any `__` substring, `content type`, `bundle`, `metadata`, or `cms` → **query-construction violation.** The `query` is 3-5 English content-domain nouns; the kind is already carried by the `metadataType` argument. Rebuild before the tool call — see `discovery-query-rules.md` § Concrete tool calls for the shape.
|
|
32
32
|
- About to run `sf project retrieve start --metadata ContentTypeBundle:<Name>` in step 1e WITHOUT first reading local `schema.json` into memory as `localSchemaBefore` → **Rule 5 violation (5a).** Retrieve overwrites `schema.json` in place; if you skip the snapshot, drift is undetectable and Cancel becomes a lie.
|
|
33
33
|
- Reading local meta.xml into a `localMetaBefore` variable, or restoring meta.xml from any snapshot on the Cancel / Deploy-local branches → **do not do this.** Retrieve returns each of the two bundle files with its own correct content — meta.xml is not user-authored and has no reconciliation role. Snapshot and restore `schema.json` only.
|
|
@@ -44,7 +44,7 @@ Copy this checklist agent-internally (do NOT print to chat). Tick each box only
|
|
|
44
44
|
- About to dispatch the step 8 trailing "create content?" prompt WITHOUT first checking `suppressCreateContentPrompt` from invocation params → **invocation-contract violation.** If the flag is `true`, step 8 is a no-op — return `{fqn, schema}` and emit `Task Completed`.
|
|
45
45
|
- About to print `intent=… | skill_selection=complete`, `grounding=…`, `mcp=…`, or any status line to chat → **output-discipline violation.** Agent-internal only, never printed.
|
|
46
46
|
- If you call any tool before step 1c is checked off → you are not following this skill correctly. Stop and start at step 1a.
|
|
47
|
-
- If your first chat message to the user contains "Proposed fields", "I'll create the files", "I'll attempt
|
|
47
|
+
- If your first chat message to the user contains "Proposed fields", "I'll create the files", "I'll attempt a substitute metadata schema lookup", or "Per the global rule" → you have skipped step 1. Stop and start at step 1a.
|
|
48
48
|
- If you emit `Task Completed` and step 5 (dry-run) or step 7 (deploy ask) is unchecked → you have violated Rule 3. Stop, run the missing steps.
|
|
49
49
|
|
|
50
50
|
If `metadata-grounding` is genuinely unreachable (real server error, not a misrouted call): record `grounding=unavailable` agent-internally, dispatch `get_content_types_for_workspace` directly (Flow 2), and continue silently to step 1d with whatever it returns.
|