@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
|
@@ -37,8 +37,8 @@ If the type is still ambiguous (for example only an environment name like "MySan
|
|
|
37
37
|
|
|
38
38
|
## Step 0 — Resolve inputs and check for an existing credential
|
|
39
39
|
|
|
40
|
-
1. Resolve `<dev-org-alias>`: the alias the user named, else the default org from `sf org display --json`. Read `result.apiVersion` as `<ver>`; it must be at least `67.0
|
|
41
|
-
2. Determine the mode. Hub mode only when reached from `hub-org.md`; every other connect is deploy mode. In deploy mode also determine the target org type and a short environment name.
|
|
40
|
+
1. Resolve `<dev-org-alias>`: the alias the user named, else the default org from `sf org display --json`. Read `result.apiVersion` as `<ver>`; it must be at least `67.0`; the alias registration below needs `68.0`, and on `67.0` the connect works but no alias is registered, so do not add the flag.
|
|
41
|
+
2. Determine the mode. Hub mode only when reached from `hub-org.md`; every other connect is deploy mode. In deploy mode also determine the target org type and a short environment name. The name is also the workspace alias. Spaces are allowed (`Dev 12 Org`), but never `default-org`, and never a name an existing alias already uses for another org: check `bash scripts/resolve-environment.sh "<dev-org-alias>"` for `aliasConflict: true` and `sf alias list` for the name. If it is taken, ask for a different one.
|
|
42
42
|
3. Check whether a usable credential already exists (`connect-api.md`, *Check credential status*).
|
|
43
43
|
- **Hub mode:** check `ALMDevOpsCenterHub`.
|
|
44
44
|
- **Deploy mode:** run the environment lookup (`list-orgs.md`) using the org's **URL, org id, or local alias only**, never the environment name the user wants to give it. If `sourceMatched` is `true`, say it cannot be connected as its own deploy target and ask for another org. If a row matches, check its `NamedCredential`. A row that matches only by name belongs to another org: that name is taken, so ask for a different one. If the user gave no URL, org id, or alias, there is nothing to match: create.
|
|
@@ -65,7 +65,7 @@ If the type is still ambiguous (for example only an environment name like "MySan
|
|
|
65
65
|
sf api request rest "/services/data/v<ver>/connect/devops/environment" \
|
|
66
66
|
--method POST \
|
|
67
67
|
--body '{"envName":"<name>","orgType":"<PRODUCTION|SANDBOX|ORGFARM>","isDevEnv":false}' \
|
|
68
|
-
--target-org <dev-org-alias>
|
|
68
|
+
--target-org "<dev-org-alias>"
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
Response: `{id, name, namedCredential, redirectUrl, orgType, ...}`. Keep `id` (the `DevopsEnvironment` Id) and `namedCredential`. Send only `envName`, `orgType`, and `isDevEnv`. A `BAD_REQUEST` naming `Invalid org type` means the value above was wrong.
|
|
@@ -76,7 +76,7 @@ Response: `{id, name, namedCredential, redirectUrl, orgType, ...}`. Keep `id` (t
|
|
|
76
76
|
sf api request rest "/services/data/v<ver>/connect/devops/setupNamedCredential" \
|
|
77
77
|
--method POST \
|
|
78
78
|
--body '{"namedCredentialName":"ALMDevOpsCenterHub","namedCredentialType":"ORG_TO_ORG"}' \
|
|
79
|
-
--target-org <dev-org-alias>
|
|
79
|
+
--target-org "<dev-org-alias>"
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
Response: `{"redirectUrl": "..."}`. In both modes replace every `&` in `redirectUrl` with `&`.
|
|
@@ -89,14 +89,14 @@ This step **requires a human** (authorization code with PKCE, stored per user).
|
|
|
89
89
|
|
|
90
90
|
> **Connect `<name>`**
|
|
91
91
|
>
|
|
92
|
-
> **[Sign in to `<name>` →](
|
|
92
|
+
> **[Sign in to `<name>` →]({{redirectUrl}})**
|
|
93
93
|
>
|
|
94
94
|
> 1. Sign in with the user DX Inspector should act as, and approve access.
|
|
95
95
|
> 2. Come back here and reply **done**.
|
|
96
96
|
>
|
|
97
97
|
> Link not working? Copy it: `<redirectUrl>`
|
|
98
98
|
|
|
99
|
-
Hub mode uses the
|
|
99
|
+
Hub mode uses the heading **Connect the Lifecycle Center org** and the link text **Connect to Lifecycle Center org**.
|
|
100
100
|
|
|
101
101
|
Rules for the link:
|
|
102
102
|
- Use the full `redirectUrl` after the `&` fix, unmodified, as the Markdown link, and again in the "Link not working?" line. Show the sign-in once; do not repeat it in other words.
|
|
@@ -122,33 +122,40 @@ The NC is created pointing at a placeholder login host. The PATCH calls `/servic
|
|
|
122
122
|
**Deploy mode:**
|
|
123
123
|
|
|
124
124
|
```bash
|
|
125
|
-
sf api request rest "/services/data/v<ver>/connect/devops/environment/<id
|
|
126
|
-
--method PATCH --target-org <dev-org-alias>
|
|
125
|
+
sf api request rest "/services/data/v<ver>/connect/devops/environment/<id>?registerWorkspaceAlias=true" \
|
|
126
|
+
--method PATCH --body '{}' --target-org "<dev-org-alias>"
|
|
127
127
|
```
|
|
128
128
|
|
|
129
|
+
`registerWorkspaceAlias=true` makes Core also register the environment name (the name the user chose) as an org alias in this workspace, next to `default-org`, so `sf ... --target-org "<name>"` works here. Core reads the token itself; the token never comes back in the response. This is best effort: if no workspace is running or the registration fails, the PATCH still succeeds and the response is unchanged. The CLI rejects a PATCH with no body, so keep `--body '{}'`. On an org below API `68.0` drop the query string (and still send `--body '{}'`); the connect completes without an alias. Send the flag only on this connect PATCH, never in hub mode.
|
|
130
|
+
|
|
129
131
|
Success returns `id`, `organizationId`, `orgUrl`, `status`, and `message`. Keep `namedCredential` from the POST. Verify `orgUrl` is a My Domain URL and **not** `login.salesforce.com` or `test.salesforce.com`.
|
|
130
132
|
|
|
133
|
+
Core names the alias after the environment (trimmed). It skips a blank name and `default-org`, and, in the Core build checked so far, a name with spaces (the environment itself still connects; only the alias is skipped until Core accepts spaced names); Core has no other rule for the alias: digits and hyphens are allowed. Only the credential name keeps just the letters of the environment name. If the local workspace gate is closed, Core registers through the remote workspace instead; the result is the same alias.
|
|
134
|
+
|
|
135
|
+
The alias is for the user's convenience in the workspace. It does not change how targets are chosen (see the rules in `SKILL.md`). The workspace token expires after about an hour. If an `sf` command with the alias fails on auth, repeat this same PATCH once to refresh it.
|
|
136
|
+
|
|
131
137
|
**Hub mode:**
|
|
132
138
|
|
|
133
139
|
```bash
|
|
134
140
|
sf api request rest "/services/data/v<ver>/connect/devops/setupNamedCredential" \
|
|
135
141
|
--method PATCH \
|
|
136
142
|
--body '{"namedCredentialName":"ALMDevOpsCenterHub","namedCredentialType":"ORG_TO_ORG"}' \
|
|
137
|
-
--target-org <dev-org-alias>
|
|
143
|
+
--target-org "<dev-org-alias>"
|
|
138
144
|
```
|
|
139
145
|
|
|
140
146
|
Success returns `{"namedCredentialName": "...", "calloutUrl": "https://<org>.my.salesforce.com", "redirectUrl": null}`. Verify `calloutUrl` the same way.
|
|
141
147
|
|
|
142
|
-
- On failure (`DOCE_CONNECTION_UPDATE_FAILED`, a 404, a userinfo failure, or `TARGET_ORG_*` codes) see `troubleshooting.md`.
|
|
148
|
+
- On failure (`DOCE_CONNECTION_UPDATE_FAILED`, a 404, a userinfo failure, or `TARGET_ORG_*` codes) see `troubleshooting.md`. A `TARGET_ORG_AUTHENTICATION_TIMEOUT` is transient: wait about 10 seconds and PATCH once more, and do not give a new sign-in link for it.
|
|
143
149
|
- **Never retry the PATCH in a loop.** **Hub mode only:** a failed PATCH also **clears the user's saved DX Inspector selections**. Tell the user.
|
|
144
150
|
|
|
145
151
|
## Step 5 — Verify and hand off
|
|
146
152
|
|
|
147
153
|
1. Re-run the status check. Expect principal `Configured` and a callout URL equal to the PATCH `calloutUrl`.
|
|
154
|
+
**Deploy mode:** also check the alias with `bash scripts/resolve-environment.sh "<dev-org-alias>" "<name>"` and read `match.readiness` (never `sf org display`, which prints the token). Registration runs in the background after the PATCH returns, so if it is `needs-sync` wait about 5 seconds and check once more. If it is still `needs-sync`, tell the user the org is connected but the workspace alias is not available yet, and offer to repeat the PATCH once. `ready` or `unverified`: say nothing about the alias.
|
|
148
155
|
2. **Hub mode only:** optionally record the hub type the way DX Inspector does. A `CORE` or `MANAGED_PACKAGE` response proves the NC works end to end.
|
|
149
156
|
|
|
150
157
|
```bash
|
|
151
|
-
sf api request rest "/services/data/v<ver>/connect/devops/doceConnectionType" --target-org <dev-org-alias>
|
|
158
|
+
sf api request rest "/services/data/v<ver>/connect/devops/doceConnectionType" --target-org "<dev-org-alias>"
|
|
152
159
|
```
|
|
153
160
|
|
|
154
161
|
3. Show the result with exactly this layout, no raw JSON, and never the credential name.
|
|
@@ -173,12 +180,55 @@ Success returns `{"namedCredentialName": "...", "calloutUrl": "https://<org>.my.
|
|
|
173
180
|
4. **Deploy mode:** re-run the environment lookup (`list-orgs.md`) and confirm the row with the `id` from Step 1 is listed, `selectable`, with its `NamedCredential`. Carry that `id` and `namedCredential` forward. If it is missing, do not deploy and do not invent an id; report that the credential is connected but the row was not found.
|
|
174
181
|
5. **If this connect started from a deploy request** (`deploy.md`, Step 2): tell the user in one sentence that `<name>` is connected and that you are continuing the deploy of the components they gave. Then go to `deploy.md`, Step 3 and Step 4. The deploy confirmation is theirs to give; do not submit anything before it. If the connect did not start from a deploy, end here and do not offer anything beyond the result.
|
|
175
182
|
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Sync workspace access (alias only)
|
|
186
|
+
|
|
187
|
+
Registers or refreshes the environment's workspace CLI alias without a sign-in. Use it when the user clicks a **Sync**, **Refresh**, or **Re-sync** button (`list-orgs.md`), asks for CLI access to a connected org, or an `sf ... --target-org "<alias>"` command fails with `Session expired or invalid`. It is the same PATCH as Step 4 and never creates an environment.
|
|
188
|
+
|
|
189
|
+
**Why it is needed.** Core registers the alias only when the connect PATCH runs with `registerWorkspaceAlias=true` against a **running** workspace. So an org connected in **DX Inspector** (the Lifecycle Center UI) has a row and a credential but no alias here; an org connected in Builder Central chat has both. Alias tokens also expire after about an hour.
|
|
190
|
+
|
|
191
|
+
1. **Find the row.** Run `bash scripts/resolve-environment.sh "<dev-org-alias>" "<name-or-alias>"`. For a failed command, pass the alias from the command. Use `match` only when `matchStatus` is `matched`.
|
|
192
|
+
- No match (`not-connected`): the alias is not a DX Inspector environment. Do **not** PATCH anything. Offer to connect it (`connect-org.md`, Step 0).
|
|
193
|
+
- `state` is `expired`: retired, not repairable. `unauthenticated`: repair path (fresh sign-in link), not a sync.
|
|
194
|
+
- `readiness` is `needs-my-signin` (`userAuth: notConfigured`): another user connected this environment and this user has not signed in. Do not sync. Use the repair path (fresh link from `GET /connect/devops/environment/<id>` `redirectUrl`, login **as this user**, PATCH once with `registerWorkspaceAlias=true`), then rebuild the list.
|
|
195
|
+
- `readiness` is `alias-conflict`: stop; the name belongs to another org (`troubleshooting.md`).
|
|
196
|
+
- Otherwise take `match.id`. A button click or the user's explicit ask is the confirmation, so do not ask again.
|
|
197
|
+
2. **PATCH once.**
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
sf api request rest "/services/data/v<ver>/connect/devops/environment/<id>?registerWorkspaceAlias=true" \
|
|
201
|
+
--method PATCH --body '{}' --target-org "<dev-org-alias>"
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
On an org below API `68.0` drop the query string; the alias cannot be registered there, so say so and stop.
|
|
205
|
+
3. **Read the outcome.**
|
|
206
|
+
|
|
207
|
+
| Result | Do |
|
|
208
|
+
|---|---|
|
|
209
|
+
| Success | Go to step 4. |
|
|
210
|
+
| `TARGET_ORG_AUTHENTICATION_TIMEOUT` (408/504) | Transient: the org did not answer in time. Wait about 10 seconds and PATCH **once more**. If it times out again, stop: "`<name>` didn't respond in time. Try again in a few minutes." Do **not** show a sign-in link and do not call the credential stale. |
|
|
211
|
+
| `TARGET_ORG_AUTHENTICATION_STATUS_CHECK_FAILED` (401/403) | The DX Inspector credential is stale or revoked. Repair path: fresh sign-in link, login, then PATCH once. |
|
|
212
|
+
| `TARGET_ORG_UNKNOWN_ERROR` | Report the plain-language cause (for example "Environment record not found" means the id is wrong; "does not have a named credential" means the connect never finished and needs repair). Stop. |
|
|
213
|
+
4. **Verify.** The alias is registered in the background after the PATCH returns, and a failure there is swallowed, so the response proves nothing about it. Wait about 5 seconds, run the resolver again, and read `readiness` for that row.
|
|
214
|
+
|
|
215
|
+
| `readiness` | Say |
|
|
216
|
+
|---|---|
|
|
217
|
+
| `ready` or `unverified` | Nothing about the alias beyond "`<name>` is ready in this workspace." |
|
|
218
|
+
| `needs-sync` | Repeat step 2 **once**. If still `needs-sync`: "`<name>` is connected and deploys work, but its CLI alias isn't available in this workspace. Registration needs a running workspace and the feature enabled for this org." Stop; never loop. |
|
|
219
|
+
| `alias-conflict` | Stop; explain the name clash. |
|
|
220
|
+
|
|
221
|
+
Registration targets the user's **already running** workspace only; it never starts one. If the CLI runs in a different workspace from the running one, the alias lands in the running one: tell the user which if they report it missing.
|
|
222
|
+
5. **Retry the command** that triggered a failed-command sync, once, **without asking**. The same applies when a task needs CLI access to an org whose `readiness` is `needs-sync` or `needs-refresh`: run steps 1 to 4 first, then the task. Listing alone still does not sync. If it fails the same way, report it and stop. Never retry with another org's alias or `default-org`.
|
|
223
|
+
6. **Batch** (`Sync all N`): run steps 1 to 4 for each row, one at a time, then report one line each (synced, timed out, sign-in needed, name clash, not available). Stop a row's retries independently; one failure does not stop the others.
|
|
224
|
+
7. **Show the list again** (`list-orgs.md`, section 4) so the user sees the result.
|
|
225
|
+
|
|
176
226
|
## Rules
|
|
177
227
|
|
|
178
228
|
- Never fabricate an NC name, callout URL, or `Configured` status. Report only what the org returned.
|
|
179
229
|
- Never print access tokens, and never pass `headerTargetAccessToken` in place of a stored connection.
|
|
180
230
|
- One environment per target org. Do not reuse a deploy NC for a different org; create a new environment.
|
|
181
231
|
- Deploy-target connections always use the Environment API so the `DevopsEnvironment` row exists. Never use `setupNamedCredential` alone for a deploy target.
|
|
182
|
-
- Never tell the user a browser was opened.
|
|
232
|
+
- Never tell the user a browser was opened. Show the sign-in as in Step 2.
|
|
183
233
|
- Do not rename `ALMDevOpsCenterHub`. DX Inspector looks it up by that exact name.
|
|
184
234
|
- Only the org-to-org types (`ORG_TO_ORG`, `ORG_TO_SANDBOX_ORG`, `ORG_TO_ORGFARM_ORG`) are used here.
|
|
@@ -83,7 +83,7 @@ sf api request rest \
|
|
|
83
83
|
"/services/data/v67.0/connect/devops/simple-deploy/deploy" \
|
|
84
84
|
--method POST \
|
|
85
85
|
--body @"$BODY" \
|
|
86
|
-
--target-org <source-org-alias>
|
|
86
|
+
--target-org "<source-org-alias>"
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
Read `response.requestId`. If it is absent, the call failed: use `references/error-handling.md`. Make **one** attempt. Never retry in a loop, never resubmit after a timeout, and never invent a `requestId`.
|
|
@@ -93,7 +93,7 @@ Read `response.requestId`. If it is absent, the call failed: use `references/err
|
|
|
93
93
|
Polling is automatic and read-only. Every check reads **two sources**, and a terminal state from **either** one ends it: the Simple Deploy status endpoint (live `step`, `metadata.deployId`) and the `DevopsRequestInfo` record for the `requestId` (`Status` is `SUCCESS` or `ERROR`; it is the same record commit polling uses).
|
|
94
94
|
|
|
95
95
|
```bash
|
|
96
|
-
bash scripts/poll-deploy-status.sh <requestId> <source-org-alias> 10 100
|
|
96
|
+
bash scripts/poll-deploy-status.sh <requestId> "<source-org-alias>" 10 100
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
Checks come at 3 s, then 5 s, then every 10 s, for at most **100 seconds**, about 2 minutes in all. Set the shell tool timeout to at least 180 seconds so the run is not killed before it exits. Progress lines (`status=… step=… request-info=…`) go to stderr; relay the current step to the user while waiting. Never say the deploy is "still waiting" after the script has printed a result.
|
|
@@ -127,7 +127,7 @@ On timeout (exit `3`, `outcome` `TIMEOUT`, about 2 minutes), stop polling and te
|
|
|
127
127
|
|
|
128
128
|
Example: "Your deploy to `<target>` hasn't reported a final status after 2 minutes. It was at `DEPLOY_METADATA` and may still be running. Request token: `<requestId>`. Deployment id: `<deployId>`. Send me the request token any time and I'll check it, or look up the deployment id in `<target>` under Setup → Deployment Status." Never resubmit, and do not keep polling.
|
|
129
129
|
|
|
130
|
-
For a one-off check, put `--once` **first**: `bash scripts/poll-deploy-status.sh --once <requestId> <source-org-alias
|
|
130
|
+
For a one-off check, put `--once` **first**: `bash scripts/poll-deploy-status.sh --once <requestId> "<source-org-alias>"`. It exits `4` while the request is still processing: report the current `step` and do not poll again unless the user asks. With `--once` there is no grace period, so `NOT_FOUND` right after a submit may be transient: say the request is not visible yet and check again shortly, not that it failed.
|
|
131
131
|
|
|
132
132
|
If the user gives a `requestId` to check (also when they come back with the id from a timeout), skip Steps 1 to 5 and check it once with `--once`, using the source org alias. If the user asks for the status without an id, use the `requestId` from earlier in this conversation; if there is none, ask for it. Then report as in Step 7.
|
|
133
133
|
|
|
@@ -5,7 +5,7 @@ The **Lifecycle Center org** is the Lifecycle Center hub that DX Inspector conne
|
|
|
5
5
|
Three rules always hold:
|
|
6
6
|
|
|
7
7
|
1. It is **never a deploy target**.
|
|
8
|
-
2. It
|
|
8
|
+
2. It appears in a list **only when it is connected** (`hub.userAuth` is `configured`), as one clearly labelled row, **Lifecycle Center (Production Org)**, with no action button and never counted in Sync all. When it is not connected, the list does not mention it.
|
|
9
9
|
3. Its credential is **never used to deploy**.
|
|
10
10
|
|
|
11
11
|
## Hub names
|
|
@@ -25,10 +25,26 @@ Run this check **before** the other routing rules.
|
|
|
25
25
|
| Connect, reconnect, repair, log in to, or authorize the Lifecycle Center org | 1. If the name is in the ambiguous group, ask: "Do you mean the Lifecycle Center org (the Lifecycle Center hub)?" On no, ask which org they mean and treat it as a normal org (Operation B). 2. On yes, or for a certain name, check the credential (`connect-org.md`, Step 0, hub mode). 3. **Configured:** reply only "The Lifecycle Center org is already configured." and stop. No reconnect offer, org details, or login link. 4. **Not configured, or half-created:** run `connect-org.md` Steps 1 to 5 in hub mode, using its sign-in layout (Step 2) and connected layout (Step 5). |
|
|
26
26
|
| Ask whether the Lifecycle Center org is connected or configured | Check the credential the same way. Configured: reply only "The Lifecycle Center org is already configured." Not configured: reply "The Lifecycle Center org is not configured. Want me to connect it?" |
|
|
27
27
|
| Deploy, validate, or quick deploy to the Lifecycle Center org | Make no API call. Ask: "Do you mean the Lifecycle Center org, or a different org?" A different org: ask which and continue at `deploy.md`, Step 2. The Lifecycle Center org: say a deploy cannot go there because it is the Lifecycle Center hub, not a deploy target, and offer to connect that org, or another one, as a regular deploy target (Operation B). Never deploy with the hub credential. |
|
|
28
|
-
| List connected orgs or environments |
|
|
29
|
-
| Show the Lifecycle Center org in the list, or asks why it is not listed |
|
|
28
|
+
| List connected orgs or environments | Follow `list-orgs.md`. Add the labelled hub row only when it is connected; otherwise say nothing about it. |
|
|
29
|
+
| Show the Lifecycle Center org in the list, or asks why it is not listed | If it is connected it is listed, labelled Lifecycle Center (Production Org). If not, say it is not connected, so it is not shown. Either way it is the Lifecycle Center hub, never a deploy target. If they want its status, check the credential and answer as above. |
|
|
30
30
|
| Remove or disconnect it | Say to use **Remove DevOps Center Connection** in DX Inspector. |
|
|
31
31
|
|
|
32
|
+
## Reading from the Lifecycle Center org
|
|
33
|
+
|
|
34
|
+
Lifecycle Center tasks (and only those) can read from the hub, for example projects and work items. **Never deploy, validate or quick-deploy with it.**
|
|
35
|
+
|
|
36
|
+
Use the credential the connection already has. It needs no workspace alias and changes no record:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
bash scripts/hub-get.sh "<dev-org-alias>" "/services/data/v<ver>/query?q=SELECT%20Id,Name%20FROM%20<Object>"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
- The script is read-only (GET). It calls the hub through `ALMDevOpsCenterHub` as the signed-in user, from the source org, and prints the JSON body. Encode spaces as `%20` and quotes as `%27`. Keep results small (add `LIMIT`): a response that is cut off is reported as a failure.
|
|
43
|
+
- Run it only after the credential check says the hub is configured (`hub.userAuth` is `configured`). For `notConfigured`, offer to connect it (Operation C); for `unknown`, try once and report the error.
|
|
44
|
+
- A non-2xx answer is reported as is: 401/403 means this user has not signed in to the hub or lacks the **DevOps Center User** permission set; say so and offer to repair the connection.
|
|
45
|
+
- **Do not** PATCH or rename the hub row from this skill; DX Inspector owns that record, and a PATCH also rewrites its callout URL and org fields.
|
|
46
|
+
- The CLI alias is the row's own name, `hub.cliAlias` (for example `Doce Hub Environment`), always double-quoted: `sf ... --target-org "<hub.cliAlias>"`. Use it only when `hub.workspaceAlias` is `registered`. When it is `missing` or `conflict` (a same-named alias points at another org), use `hub-get.sh`; do not create the alias or invent a different one. Reads only: never deploy, validate or change data with it.
|
|
47
|
+
|
|
32
48
|
## Notes for the connect flow
|
|
33
49
|
|
|
34
50
|
- Hub mode has no `DevopsEnvironment` row: it uses `setupNamedCredential` with the fixed name `ALMDevOpsCenterHub`.
|
|
@@ -7,9 +7,11 @@ The targets are the DX Inspector environments, **not** the orgs authorized on th
|
|
|
7
7
|
## 1. Run the resolver
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
bash scripts/resolve-environment.sh <source-org-alias> [identifier]
|
|
10
|
+
bash scripts/resolve-environment.sh "<source-org-alias>" ["<identifier>"] [--check-sessions]
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
Add `--check-sessions` when showing the list (section 4). It probes each workspace login that belongs to a listed environment with one cheap query and fills `session`. Leave it off when only resolving a target for Deploy or Connect: the session probes are skipped there (the per-user sign-in check and the hub read still run, in parallel with a timeout), so that path needs no extra org calls.
|
|
14
|
+
|
|
13
15
|
`<source-org-alias>` is the alias the user named, else the default org from `sf org display --json`. Pass `identifier` exactly as the user gave it. It accepts:
|
|
14
16
|
|
|
15
17
|
| The user gives | Example |
|
|
@@ -22,10 +24,10 @@ bash scripts/resolve-environment.sh <source-org-alias> [identifier]
|
|
|
22
24
|
The script runs `SELECT Id, Name, NamedCredential, OrgType, IsExpired, OrgUrl, OrgIdentifier FROM DevopsEnvironment ORDER BY Name` and prints one JSON document:
|
|
23
25
|
|
|
24
26
|
- `source`: `alias`, `username`, `orgId`, `instanceUrl` of the source org.
|
|
25
|
-
- `environments[]`: each row with `state`
|
|
27
|
+
- `environments[]`: each row with `state` (`selectable`, `expired`, `unauthenticated`) and the workspace fields. `workspaceAlias` is `registered`, `missing`, or `unknown`, and `workspaceAliasName` is the `sf` alias that holds the login (named like the environment, or any alias on the same org). `session` is `valid`, `expired`, or `unknown` (only with `--check-sessions`; `unknown` also covers a probe that timed out). `userAuth` is `configured`, `notConfigured`, or `unknown`: whether the **current user** has signed in to that environment (rows are shared by everyone with access to the dev org, the login is per user; `unknown` means the check failed, never treated as not signed in). `aliasConflict` is `true` when an alias named like the environment points at a different org. `readiness` combines them: `ready`, `needs-sync`, `needs-refresh`, `alias-conflict`, `needs-my-signin`, `needs-signin`, `retired`, or `unverified`. `needs-my-signin` wins over every sync state: the row is connected, but not by this user. Aliases are never used to choose a target.
|
|
26
28
|
- With an identifier: `matchStatus`, `matches[]`, `match`, and `sourceMatched`.
|
|
27
29
|
|
|
28
|
-
The Lifecycle Center org's own row is never
|
|
30
|
+
The Lifecycle Center org's own row is never in `environments[]`. The resolver reports it separately as `hub` (`label`, `url`, `userAuth`, `workspaceAlias` as `registered`, `missing`, `conflict` or `unknown`, `cliAlias`, `isDeployTarget: false`), present only when the hub is connected: its row exists or its credential is readable (see `hub-org.md`).
|
|
29
31
|
|
|
30
32
|
## 2. If the script fails
|
|
31
33
|
|
|
@@ -34,7 +36,7 @@ It exits `1` and prints one reason on stderr. Say only what the reason supports:
|
|
|
34
36
|
| Script says | Tell the user | Then |
|
|
35
37
|
|---|---|---|
|
|
36
38
|
| `DevOps Center not enabled or no access` | "DX Inspector isn't enabled for this org or user, so there are no environments to list or deploy to. An admin needs to enable it." | Stop. Do not run another query, do not fall back to `sf org list`, and do not offer a deploy. |
|
|
37
|
-
| `query failed, not an enablement problem` | The error in plain words (often an expired session). | Tell them to reconnect the source org (in Builder Central use the Reconnect prompt; running the CLI locally, `sf org login web --alias <alias
|
|
39
|
+
| `query failed, not an enablement problem` | The error in plain words (often an expired session). | Tell them to reconnect the source org (in Builder Central use the Reconnect prompt; running the CLI locally, `sf org login web --alias "<alias>"`), then try again. Never say DX Inspector is disabled. |
|
|
38
40
|
| `unexpected query result` | The environment lookup returned something unreadable. | Report that and stop. Do not guess a list. |
|
|
39
41
|
| `cannot read source org` | The source org is not authorized on this machine. | Ask which org they build in. If it is not authorized, reconnect it the same way as above, then start again. |
|
|
40
42
|
| `jq required` | `jq` is missing from the environment. | Report it and stop. |
|
|
@@ -52,43 +54,67 @@ It exits `1` and prints one reason on stderr. Say only what the reason supports:
|
|
|
52
54
|
| `not-connected` | Not in DX Inspector. Offer to connect it (`connect-org.md`). If the identifier was an alias, URL, or org id, carry it into the connect flow so only the missing inputs are asked. |
|
|
53
55
|
| `none-requested` | No target named: show the list (section 4). |
|
|
54
56
|
|
|
55
|
-
When the identifier is an alias that is not connected, `sf org display --target-org <alias> --json` gives its URL, which sets the `orgType` by the host table in `connect-org.md`. Use the alias as the suggested environment name
|
|
57
|
+
When the identifier is an alias that is not connected, `sf org display --target-org "<alias>" --json` gives its URL, which sets the `orgType` by the host table in `connect-org.md`. Use the alias as the suggested environment name and still ask the user to confirm the type if the host does not decide it.
|
|
56
58
|
|
|
57
59
|
## 4. Show the list
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
Show the orgs the user can use, then say in one line what is left out.
|
|
62
|
+
|
|
63
|
+
**Table** (columns `#`, `Name`, `Type`, `URL`, `Org id`): one row per environment with `state = selectable`. **Never list the current (source) org.** It is not a deploy target, so leave out any row with `isSource: true` and do not append a row for `source`. Mention the current org only if the user asks about it (section 5).
|
|
60
64
|
|
|
61
|
-
-
|
|
65
|
+
- **Lifecycle Center row.** When `hub` is present and `hub.userAuth` is `configured`, add one last row: Name `Lifecycle Center (Production Org)`, Type `Production`, URL from `hub.url`, Org id `—`. Follow the table with: "Lifecycle Center (Production Org) is the Lifecycle Center hub. It is not a deploy target." It gets no button and is never in Sync all. If `hub` is null or not `configured`, say nothing about it.
|
|
62
66
|
- Always include the `Org id` column. Write `—` for any empty cell.
|
|
63
|
-
-
|
|
64
|
-
- Never show row ids or credential names.
|
|
65
|
-
-
|
|
67
|
+
- **Same org under several names.** Environments are separate connections, so two or more can point at one org (same `Org id`). Keep each row, but add one line after the table: "`<A>`, `<B>` and `<C>` are three connections to the same org (`<Org id>`)." Tell the user this whenever they ask to copy or move something between two of them: it would do nothing or create a duplicate, so offer a genuinely different org instead.
|
|
68
|
+
- Never show row ids or credential names. If several rows share a name, tell them apart by URL.
|
|
69
|
+
- There is no status column. The state is shown as the **action button** under the table (below), so the user fixes a row with one click instead of reading a status.
|
|
66
70
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
| `
|
|
72
|
-
|
|
71
|
+
**Where the list comes from.** Rows are the DX Inspector environments, so an org connected in DX Inspector (the Lifecycle Center UI) is listed even though it was never connected from Builder Central chat. Such an org has a credential but **no workspace CLI alias**, so `sf ... --target-org "<name>"` fails here until it is synced. An org connected from Builder Central chat gets both the row and the alias. The buttons cover both cases.
|
|
72
|
+
|
|
73
|
+
**Actions.** Under the table, offer one text action per selectable row, plus the batch action, as a short list. The user replying with the action (or the message shown) is their confirmation. The label depends on `readiness`:
|
|
74
|
+
|
|
75
|
+
| `readiness` | Button label | Message sent on click | What the click does |
|
|
76
|
+
|---|---|---|---|
|
|
77
|
+
| `needs-sync` | Sync `<name>` | `Sync workspace access for <name>` | Sync procedure (`connect-org.md`, *Sync workspace access*) |
|
|
78
|
+
| `unverified` | Sync `<name>` | same | same |
|
|
79
|
+
| `needs-refresh` | Refresh `<name>` | `Refresh workspace access for <name>` | same procedure |
|
|
80
|
+
| `ready` | Re-sync `<name>` | `Sync workspace access for <name>` | same procedure (safe: it overwrites the same alias with a fresh token) |
|
|
81
|
+
| `alias-conflict` | Fix name `<name>` | `Fix the workspace alias name for <name>` | Do **not** PATCH. Explain the clash and offer `sf alias unset` or a different name (`troubleshooting.md`) |
|
|
82
|
+
| `needs-my-signin` | Sign in as me: `<name>` | `Sign me in to <name>` | Per-user sign-in: repair path in `connect-org.md` (fresh link, login as this user, PATCH once). No sync before it; a sync would fail with 401/403 |
|
|
83
|
+
| `needs-signin` | Finish sign-in `<name>` | `Finish connecting <name>` | Repair path in `connect-org.md` |
|
|
84
|
+
| `retired` | none | | Not repairable; goes in the left-out line |
|
|
85
|
+
|
|
86
|
+
- When **two or more** rows are `needs-sync`, `needs-refresh`, or `unverified`, add a first button **Sync all N** (message `Sync workspace access for all connected orgs`). The batch runs the sync procedure for each of those rows in turn, one PATCH each, never in parallel, and reports one line per org.
|
|
87
|
+
- The source org row has no button.
|
|
88
|
+
- **Orgs connected by someone else.** Everyone with access to the dev org sees the same environments, but the sign-in belongs to one user. A `needs-my-signin` row is listed with its "Sign in as me" button, and one line goes after the table: "N orgs were connected by someone else; sign in to use them." Never offer Sync (or include the row in Sync all) for such a row. Do not claim it is unusable: deploys use the signed-in user's credential, so it is not deployable for this user until they sign in.
|
|
89
|
+
- No selectable row needs an action: skip the list. Otherwise, if the list would be long, add one sentence after the table naming the rows that need syncing and asking if they want them synced.
|
|
90
|
+
- Deploys run through DX Inspector's credential, not the workspace alias, so a row that needs a sync is still deployable. Say so only if the user asks.
|
|
91
|
+
- **Never sync by itself while listing.** A list is read-only. The sync runs only after a button click or an explicit request.
|
|
92
|
+
|
|
93
|
+
After a click the agent runs the procedure, then **shows the list again**, so the user sees the result. The list is rebuilt from a fresh resolver run, not from memory.
|
|
94
|
+
|
|
95
|
+
**Left-out line** (only if any row is `needs-signin` or `retired`; one sentence, placed after the table): "Not shown as usable: `<name>` (sign-in not finished), `<name>` (retired or replaced)." Details only if the user asks.
|
|
96
|
+
|
|
97
|
+
**Example** (table, then the button row):
|
|
98
|
+
|
|
99
|
+
| # | Name | Type | URL | Org id |
|
|
100
|
+
|---|---|---|---|---|
|
|
101
|
+
| 1 | MySandbox | Sandbox | mydomain--mysandbox.sandbox.my.salesforce.com | 00D5g000001AbCd |
|
|
102
|
+
| 2 | QaSandbox | Sandbox | mydomain--qa.sandbox.my.salesforce.com | 00D5g000001QqQq |
|
|
73
103
|
|
|
74
|
-
|
|
104
|
+
The current org (`my-alias`) is not listed. Buttons: **Sync all 2**, **Re-sync MySandbox**, **Refresh QaSandbox**.
|
|
75
105
|
|
|
76
|
-
|
|
77
|
-
|---|---|---|---|---|---|
|
|
78
|
-
| 1 | MySandbox | Sandbox | mydomain--mysandbox.sandbox.my.salesforce.com | 00D5g000001AbCd | Selectable |
|
|
79
|
-
| 2 | OldSandbox | Sandbox | mydomain--old.sandbox.my.salesforce.com | — | Retired or replaced |
|
|
80
|
-
| 3 | my-alias *(current org, source)* | — | mydomain.my.salesforce.com | 00D5g000001XyZw | — |
|
|
106
|
+
Not shown as usable: OldSandbox (retired or replaced).
|
|
81
107
|
|
|
82
108
|
End the list with exactly this sentence and nothing after it:
|
|
83
109
|
|
|
84
110
|
> Want to deploy to an org that isn't listed? I can help you connect a new one.
|
|
85
111
|
|
|
86
|
-
Do not add any other offer, summary, or follow-up.
|
|
112
|
+
Do not add any other offer, summary, or follow-up. The action buttons are the only addition.
|
|
87
113
|
|
|
88
114
|
| Situation | Reply instead of the table |
|
|
89
115
|
|---|---|
|
|
90
116
|
| No environments | "No environments are connected to DX Inspector in `<source-org-alias>` yet." Then the closing sentence. |
|
|
91
|
-
|
|
|
117
|
+
| No row has `state = selectable` | "None of the connected environments can accept a deploy right now: <names and reasons>." Then the closing sentence. |
|
|
92
118
|
|
|
93
119
|
## 5. Current-org details
|
|
94
120
|
|
|
@@ -14,10 +14,15 @@ Explain each problem to the user in plain language. Never echo raw JSON or token
|
|
|
14
14
|
| User can't use the credential | Missing **Access DevOps Center Named Credentials** (`AccessDevOpsCenterNamedCredentials`) | Assign that permission set to the user in the dev org. |
|
|
15
15
|
| Hub PATCH returns `404 Named credential does not exist` | POST never created the NC, or the name differs | Re-check the exact name (case-sensitive) and re-run Step 1. |
|
|
16
16
|
| Hub PATCH returns `DOCE_CONNECTION_UPDATE_FAILED` | The `userinfo` callout failed, usually because the OAuth token is missing or expired | Confirm the principal is `Configured`, then re-run Steps 1–4. The user's saved DX Inspector selections were cleared, so they must pick them again. |
|
|
17
|
-
| Deploy environment PATCH returns `
|
|
17
|
+
| Deploy environment PATCH returns `TARGET_ORG_AUTHENTICATION_TIMEOUT` (408/504) | The target org or its login service did not answer in time. This says nothing about the credential | Wait about 10 seconds and PATCH once more. If it times out again, tell the user the org didn't respond and to try later. Do not give a sign-in link and do not delete or recreate anything. |
|
|
18
|
+
| Deploy environment PATCH returns `TARGET_ORG_AUTHENTICATION_STATUS_CHECK_FAILED` (401/403) | The login is missing, expired, or revoked | Confirm the principal is `Configured` and the `id` is the POST's. Give a fresh link and PATCH once. Do not loop. |
|
|
19
|
+
| Deploy environment PATCH returns `TARGET_ORG_UNKNOWN_ERROR` (includes "Environment record not found" and "does not have a named credential") | The id is wrong, or the connect never finished | Re-resolve the id from the environment list. If the row has no credential, use the repair path. Do not loop. |
|
|
18
20
|
| PATCH `calloutUrl` or `orgUrl` is still a login host | Unexpected `userinfo` response | Stop and report. Do not hand the NC to deploy. |
|
|
19
21
|
| Hub mode: `doceConnectionType` fails | The hub user lacks **DevOps Center User** | Assign the permission set in the Lifecycle Center org, then re-run the check. |
|
|
20
22
|
| Deploy: `TARGET_ORG_SESSION_EXPIRED` or `Bad_OAuth_Token` | The target refresh token was revoked or expired. A stale token is not visible in the environment list; it only shows at deploy time | Repair: fresh link from `GET /connect/devops/environment/<id>`, user logs in, PATCH once. |
|
|
23
|
+
| Connected, but `sf ... --target-org "<name>"` says the alias is unknown | The alias POST is best effort and its failure is swallowed (no running workspace, workspace still booting past the retries, or the environment name was blank, had spaces, or was `default-org`) | Repeat the connect PATCH with `?registerWorkspaceAlias=true` and `--body '{}'` once, then re-check with `resolve-environment.sh`. If it is still missing, say the org is connected and deploys still work, and stop. |
|
|
24
|
+
| `sf` with the alias says `Session expired or invalid` (also `INVALID_SESSION_ID`, `RefreshTokenAuthError`) | The token the workspace holds is short-lived and was not refreshed. This is the workspace login, not the DX Inspector credential | Map the alias to its environment, say "Your workspace login to `<name>` expired", repeat the same PATCH once (no browser needed), then retry the failed command once. If the PATCH fails on auth, the DX Inspector login is stale: repair path (fresh sign-in link, login, PATCH). Never retry with another org's alias or `default-org`. |
|
|
25
|
+
| Environment shows `alias-conflict` | An `sf` alias with the environment name already points at a different org in this workspace. Repeating the PATCH would overwrite that alias | Do not repeat the PATCH. Ask the user to remove or rename the other alias (`sf alias unset "<name>"`), or reconnect under a different name. |
|
|
21
26
|
| Environment shows `unauthenticated` (empty `OrgUrl` or `OrgIdentifier`) | The connect never finished: POST ran but login or PATCH did not | Same repair: fresh link, login, PATCH once. Do not POST again. |
|
|
22
27
|
| `Doce Hub Environment` row is missing from the environment list | By design: the resolver drops the hub row (credential `ALMDevOpsCenterHub`, empty `OrgUrl`) because it is the Lifecycle Center hub, not a deploy target | Nothing to repair. To deploy to that org, connect it as a deploy target with the Environment API. |
|
|
23
28
|
| Environment shows `expired` | `IsExpired` is set when an environment is retired or replaced by a swap; it is not an OAuth expiry | Do not repair it. Pick another environment or connect a new one. |
|
|
@@ -29,3 +34,19 @@ Explain each problem to the user in plain language. Never echo raw JSON or token
|
|
|
29
34
|
**Hub:** delete both the **Named Credential** and the **External Credential** named `ALMDevOpsCenterHub` in Setup → Named Credentials (and the External Credentials tab), and run the skill again.
|
|
30
35
|
|
|
31
36
|
For the hub, the **Remove DevOps Center Connection** option in DX Inspector does the same teardown.
|
|
37
|
+
|
|
38
|
+
## Org connected in DX Inspector, not in Builder Central
|
|
39
|
+
|
|
40
|
+
An environment connected through the DX Inspector UI (Lifecycle Center) has a `DevopsEnvironment` row and a credential but no workspace alias. It appears in the list with a **Sync** button; `sf ... --target-org "<name>"` fails until it is synced (`connect-org.md`, *Sync workspace access*). No sign-in is needed while the credential is `Configured`.
|
|
41
|
+
|
|
42
|
+
## Alias registration does not happen even after a sync
|
|
43
|
+
|
|
44
|
+
The PATCH succeeds but the alias never appears. The causes are on the server and invisible to the CLI: the feature gate is closed for the org, no workspace is running for the user, or the environment name is blank, contains whitespace, or is `default-org` in any casing. Repeat the sync once. If it still shows `needs-sync`, say the org is connected and deployable but has no CLI alias here, and stop.
|
|
45
|
+
|
|
46
|
+
## Org listed, but connected by another user
|
|
47
|
+
|
|
48
|
+
| Symptom | Cause | Fix |
|
|
49
|
+
|---|---|---|
|
|
50
|
+
| Row shows `needs-my-signin` (`userAuth: notConfigured`) | DX Inspector environments are shared by everyone with access to the dev org, but the OAuth login is per user and this user has not signed in | Use the "Sign in as me" button: fresh sign-in link, log in **as this user**, PATCH once (repair path in `connect-org.md`). Do not sync first |
|
|
51
|
+
| Sync or deploy returns 401/403 on an org someone else connected | Same cause, found late | Treat as `needs-my-signin` |
|
|
52
|
+
| `userAuth: unknown` on every row | The credential status call failed (API version, permission, network) | List as usual; if a click then fails with 401/403, go to the row above |
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Read-only GET against the Lifecycle Center org through the DX Inspector credential (ALMDevOpsCenterHub).
|
|
3
|
+
# No workspace alias and no record change: the call runs as the signed-in user, from the source org.
|
|
4
|
+
#
|
|
5
|
+
# Usage: hub-get.sh <source-org-alias> </services/data/vNN.N/...path?query>
|
|
6
|
+
# Prints the response body (JSON) on stdout. Exit codes: 0 HTTP 2xx, 1 usage / not 2xx / call failed.
|
|
7
|
+
set -uo pipefail
|
|
8
|
+
|
|
9
|
+
command -v jq >/dev/null || { echo "jq required" >&2; exit 1; }
|
|
10
|
+
SRC="${1:-}"; REQ="${2:-}"
|
|
11
|
+
[ -n "$SRC" ] && [ -n "$REQ" ] || { echo "usage: hub-get.sh <source-org-alias> </services/data/vNN.N/...>" >&2; exit 1; }
|
|
12
|
+
case "$REQ" in */../*|*/..|*%2e%2e*|*%2E%2E*) echo "path must not contain .." >&2; exit 1 ;; esac
|
|
13
|
+
printf '%s' "$REQ" | grep -Eq '^/services/data/v[0-9]+\.[0-9]+/' || { echo "path must start with /services/data/v<version>/" >&2; exit 1; }
|
|
14
|
+
# The path goes into an Apex string literal: allow only URL-safe characters (no quotes, backslashes, or whitespace).
|
|
15
|
+
printf '%s' "$REQ" | grep -Eq "^[A-Za-z0-9/._~%+=&?,:*()-]+$" || { echo "path has characters that are not allowed (encode spaces as %20 and quotes as %27)" >&2; exit 1; }
|
|
16
|
+
|
|
17
|
+
apex=$(mktemp "${TMPDIR:-/tmp}/hub-get.XXXXXX") || exit 1
|
|
18
|
+
trap 'rm -f "$apex"' EXIT
|
|
19
|
+
cat > "$apex" <<APEX
|
|
20
|
+
HttpRequest r = new HttpRequest();
|
|
21
|
+
r.setEndpoint('callout:ALMDevOpsCenterHub${REQ}');
|
|
22
|
+
r.setMethod('GET');
|
|
23
|
+
r.setHeader('Accept', 'application/json');
|
|
24
|
+
HttpResponse s = new Http().send(r);
|
|
25
|
+
System.debug('HUBGET ' + s.getStatusCode() + ' ' + EncodingUtil.base64Encode(Blob.valueOf(s.getBody())));
|
|
26
|
+
APEX
|
|
27
|
+
# One retry after a short pause covers a refreshing session or a transient hub error.
|
|
28
|
+
for attempt in 1 2; do
|
|
29
|
+
out=$(env FORCE_COLOR=0 SF_CLI_DISABLE_AUTOUPDATE=true sf apex run --file "$apex" --target-org "$SRC" --json 2>/dev/null) && \
|
|
30
|
+
line=$(printf '%s' "$out" | jq -r '.result.logs // ""' | grep -o 'HUBGET [0-9]* [A-Za-z0-9+/=]*' | head -1) || line=""
|
|
31
|
+
case "$line" in "HUBGET 5"*|"HUBGET 408"*|"") [ "$attempt" = 1 ] && { sleep 3; continue; } ;; esac
|
|
32
|
+
break
|
|
33
|
+
done
|
|
34
|
+
[ -n "$line" ] || { echo "no response captured; the callout failed (session expired, Apex not permitted, or the credential is not usable for this user): $(printf '%s' "$out" | jq -r '.result.exceptionMessage // .message // "unknown"' 2>/dev/null | head -c 200)" >&2; exit 1; }
|
|
35
|
+
code=$(printf '%s' "$line" | cut -d' ' -f2)
|
|
36
|
+
b64=$(printf '%s' "$line" | cut -d' ' -f3)
|
|
37
|
+
body=$(printf '%s' "$b64" | base64 -d 2>/dev/null || printf '%s' "$b64" | base64 -D 2>/dev/null)
|
|
38
|
+
# A truncated debug log decodes to partial JSON: never return it as a success.
|
|
39
|
+
printf '%s' "$body" | jq -e . >/dev/null 2>&1 || { echo "response was cut off or is not JSON; narrow the query (add LIMIT)" >&2; exit 1; }
|
|
40
|
+
printf '%s\n' "$body"
|
|
41
|
+
case "$code" in 2??) exit 0 ;; *) echo "hub returned HTTP $code" >&2; exit 1 ;; esac
|