@salesforce/afv-skills 1.14.0 → 1.16.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/activating-datacloud/SKILL.md +0 -1
- package/skills/analyzing-omnistudio-dependencies/SKILL.md +0 -1
- package/skills/applying-slds/SKILL.md +322 -0
- package/skills/applying-slds/checklists.md +83 -0
- package/skills/applying-slds/examples.md +283 -0
- package/skills/applying-slds/guidance/README.md +83 -0
- package/skills/applying-slds/guidance/blueprints-index.md +213 -0
- package/skills/applying-slds/guidance/icons-guidance.md +186 -0
- package/skills/applying-slds/guidance/overviews/borders.md +236 -0
- package/skills/applying-slds/guidance/overviews/color.md +266 -0
- package/skills/applying-slds/guidance/overviews/display-density.md +366 -0
- package/skills/applying-slds/guidance/overviews/icons.md +240 -0
- package/skills/applying-slds/guidance/overviews/illustrations.md +235 -0
- package/skills/applying-slds/guidance/overviews/shadows.md +176 -0
- package/skills/applying-slds/guidance/overviews/spacing.md +216 -0
- package/skills/applying-slds/guidance/overviews/typography.md +323 -0
- package/skills/applying-slds/guidance/overviews/utilities.md +542 -0
- package/skills/applying-slds/guidance/slds-development-guide.md +288 -0
- package/skills/applying-slds/guidance/styling-hooks/borders.md +202 -0
- package/skills/applying-slds/guidance/styling-hooks/color/expressive-palette-hooks.md +153 -0
- package/skills/applying-slds/guidance/styling-hooks/color/index.md +171 -0
- package/skills/applying-slds/guidance/styling-hooks/color/semantic/accent-hooks.md +204 -0
- package/skills/applying-slds/guidance/styling-hooks/color/semantic/feedback-hooks.md +768 -0
- package/skills/applying-slds/guidance/styling-hooks/color/semantic/surface-hooks.md +337 -0
- package/skills/applying-slds/guidance/styling-hooks/color/system-hooks.md +132 -0
- package/skills/applying-slds/guidance/styling-hooks/index.md +327 -0
- package/skills/applying-slds/guidance/styling-hooks/shadows.md +238 -0
- package/skills/applying-slds/guidance/styling-hooks/spacing.md +254 -0
- package/skills/applying-slds/guidance/styling-hooks/typography.md +448 -0
- package/skills/applying-slds/guidance/utilities/alignment.md +119 -0
- package/skills/applying-slds/guidance/utilities/borders.md +131 -0
- package/skills/applying-slds/guidance/utilities/box.md +125 -0
- package/skills/applying-slds/guidance/utilities/color.md +165 -0
- package/skills/applying-slds/guidance/utilities/dark-mode.md +111 -0
- package/skills/applying-slds/guidance/utilities/description-list.md +168 -0
- package/skills/applying-slds/guidance/utilities/floats.md +117 -0
- package/skills/applying-slds/guidance/utilities/grid.md +264 -0
- package/skills/applying-slds/guidance/utilities/horizontal-list.md +110 -0
- package/skills/applying-slds/guidance/utilities/hyphenation.md +84 -0
- package/skills/applying-slds/guidance/utilities/index.md +205 -0
- package/skills/applying-slds/guidance/utilities/interactions.md +89 -0
- package/skills/applying-slds/guidance/utilities/layout.md +109 -0
- package/skills/applying-slds/guidance/utilities/line-clamp.md +131 -0
- package/skills/applying-slds/guidance/utilities/margin.md +155 -0
- package/skills/applying-slds/guidance/utilities/media-object.md +161 -0
- package/skills/applying-slds/guidance/utilities/name-value-list.md +152 -0
- package/skills/applying-slds/guidance/utilities/padding.md +155 -0
- package/skills/applying-slds/guidance/utilities/position.md +177 -0
- package/skills/applying-slds/guidance/utilities/print.md +114 -0
- package/skills/applying-slds/guidance/utilities/scrollable.md +126 -0
- package/skills/applying-slds/guidance/utilities/sizing.md +190 -0
- package/skills/applying-slds/guidance/utilities/themes.md +121 -0
- package/skills/applying-slds/guidance/utilities/truncate.md +127 -0
- package/skills/applying-slds/guidance/utilities/typography.md +166 -0
- package/skills/applying-slds/guidance/utilities/vertical-list.md +166 -0
- package/skills/applying-slds/guidance/utilities/visibility.md +228 -0
- package/skills/applying-slds/metadata/README.md +84 -0
- package/skills/applying-slds/metadata/blueprints/components/accordion.yaml +304 -0
- package/skills/applying-slds/metadata/blueprints/components/activity-timeline.yaml +92 -0
- package/skills/applying-slds/metadata/blueprints/components/alert.yaml +103 -0
- package/skills/applying-slds/metadata/blueprints/components/app-launcher.yaml +94 -0
- package/skills/applying-slds/metadata/blueprints/components/avatar-group.yaml +81 -0
- package/skills/applying-slds/metadata/blueprints/components/avatar.yaml +97 -0
- package/skills/applying-slds/metadata/blueprints/components/badges.yaml +102 -0
- package/skills/applying-slds/metadata/blueprints/components/brand-band.yaml +198 -0
- package/skills/applying-slds/metadata/blueprints/components/breadcrumbs.yaml +95 -0
- package/skills/applying-slds/metadata/blueprints/components/builder-header.yaml +192 -0
- package/skills/applying-slds/metadata/blueprints/components/button-groups.yaml +82 -0
- package/skills/applying-slds/metadata/blueprints/components/button-icons.yaml +295 -0
- package/skills/applying-slds/metadata/blueprints/components/buttons.yaml +230 -0
- package/skills/applying-slds/metadata/blueprints/components/cards.yaml +124 -0
- package/skills/applying-slds/metadata/blueprints/components/carousel.yaml +140 -0
- package/skills/applying-slds/metadata/blueprints/components/chat.yaml +179 -0
- package/skills/applying-slds/metadata/blueprints/components/checkbox-button-group.yaml +192 -0
- package/skills/applying-slds/metadata/blueprints/components/checkbox-button.yaml +204 -0
- package/skills/applying-slds/metadata/blueprints/components/checkbox-toggle.yaml +177 -0
- package/skills/applying-slds/metadata/blueprints/components/checkbox.yaml +108 -0
- package/skills/applying-slds/metadata/blueprints/components/color-picker.yaml +172 -0
- package/skills/applying-slds/metadata/blueprints/components/combobox.yaml +136 -0
- package/skills/applying-slds/metadata/blueprints/components/counter.yaml +147 -0
- package/skills/applying-slds/metadata/blueprints/components/data-tables.yaml +157 -0
- package/skills/applying-slds/metadata/blueprints/components/datepickers.yaml +130 -0
- package/skills/applying-slds/metadata/blueprints/components/datetime-picker.yaml +155 -0
- package/skills/applying-slds/metadata/blueprints/components/docked-composer.yaml +201 -0
- package/skills/applying-slds/metadata/blueprints/components/docked-form-footer.yaml +161 -0
- package/skills/applying-slds/metadata/blueprints/components/docked-utility-bar.yaml +175 -0
- package/skills/applying-slds/metadata/blueprints/components/drop-zone.yaml +115 -0
- package/skills/applying-slds/metadata/blueprints/components/dueling-picklist.yaml +196 -0
- package/skills/applying-slds/metadata/blueprints/components/dynamic-icons.yaml +128 -0
- package/skills/applying-slds/metadata/blueprints/components/dynamic-menu.yaml +141 -0
- package/skills/applying-slds/metadata/blueprints/components/expandable-section.yaml +115 -0
- package/skills/applying-slds/metadata/blueprints/components/expression.yaml +143 -0
- package/skills/applying-slds/metadata/blueprints/components/feeds.yaml +125 -0
- package/skills/applying-slds/metadata/blueprints/components/file-selector.yaml +154 -0
- package/skills/applying-slds/metadata/blueprints/components/files.yaml +119 -0
- package/skills/applying-slds/metadata/blueprints/components/form-element.yaml +145 -0
- package/skills/applying-slds/metadata/blueprints/components/global-header.yaml +120 -0
- package/skills/applying-slds/metadata/blueprints/components/global-navigation.yaml +100 -0
- package/skills/applying-slds/metadata/blueprints/components/icons.yaml +138 -0
- package/skills/applying-slds/metadata/blueprints/components/illustration.yaml +205 -0
- package/skills/applying-slds/metadata/blueprints/components/input.yaml +151 -0
- package/skills/applying-slds/metadata/blueprints/components/list-builder.yaml +127 -0
- package/skills/applying-slds/metadata/blueprints/components/lookups.yaml +132 -0
- package/skills/applying-slds/metadata/blueprints/components/map.yaml +118 -0
- package/skills/applying-slds/metadata/blueprints/components/menus.yaml +134 -0
- package/skills/applying-slds/metadata/blueprints/components/modals.yaml +152 -0
- package/skills/applying-slds/metadata/blueprints/components/notifications.yaml +88 -0
- package/skills/applying-slds/metadata/blueprints/components/page-headers.yaml +135 -0
- package/skills/applying-slds/metadata/blueprints/components/panels.yaml +149 -0
- package/skills/applying-slds/metadata/blueprints/components/path.yaml +154 -0
- package/skills/applying-slds/metadata/blueprints/components/picklist.yaml +125 -0
- package/skills/applying-slds/metadata/blueprints/components/pills.yaml +154 -0
- package/skills/applying-slds/metadata/blueprints/components/popovers.yaml +120 -0
- package/skills/applying-slds/metadata/blueprints/components/progress-bar.yaml +110 -0
- package/skills/applying-slds/metadata/blueprints/components/progress-indicator.yaml +133 -0
- package/skills/applying-slds/metadata/blueprints/components/progress-ring.yaml +102 -0
- package/skills/applying-slds/metadata/blueprints/components/prompt.yaml +126 -0
- package/skills/applying-slds/metadata/blueprints/components/publishers.yaml +178 -0
- package/skills/applying-slds/metadata/blueprints/components/radio-button-group.yaml +172 -0
- package/skills/applying-slds/metadata/blueprints/components/radio-group.yaml +112 -0
- package/skills/applying-slds/metadata/blueprints/components/rich-text-editor.yaml +135 -0
- package/skills/applying-slds/metadata/blueprints/components/scoped-notifications.yaml +188 -0
- package/skills/applying-slds/metadata/blueprints/components/scoped-tabs.yaml +97 -0
- package/skills/applying-slds/metadata/blueprints/components/select.yaml +127 -0
- package/skills/applying-slds/metadata/blueprints/components/setup-assistant.yaml +152 -0
- package/skills/applying-slds/metadata/blueprints/components/slider.yaml +111 -0
- package/skills/applying-slds/metadata/blueprints/components/spinners.yaml +135 -0
- package/skills/applying-slds/metadata/blueprints/components/split-view.yaml +112 -0
- package/skills/applying-slds/metadata/blueprints/components/summary-detail.yaml +103 -0
- package/skills/applying-slds/metadata/blueprints/components/tabs.yaml +138 -0
- package/skills/applying-slds/metadata/blueprints/components/textarea.yaml +116 -0
- package/skills/applying-slds/metadata/blueprints/components/tiles.yaml +108 -0
- package/skills/applying-slds/metadata/blueprints/components/timepicker.yaml +111 -0
- package/skills/applying-slds/metadata/blueprints/components/toast.yaml +154 -0
- package/skills/applying-slds/metadata/blueprints/components/tooltips.yaml +107 -0
- package/skills/applying-slds/metadata/blueprints/components/tree-grid.yaml +116 -0
- package/skills/applying-slds/metadata/blueprints/components/trees.yaml +116 -0
- package/skills/applying-slds/metadata/blueprints/components/trial-bar.yaml +112 -0
- package/skills/applying-slds/metadata/blueprints/components/vertical-navigation.yaml +130 -0
- package/skills/applying-slds/metadata/blueprints/components/vertical-tabs.yaml +140 -0
- package/skills/applying-slds/metadata/blueprints/components/visual-picker.yaml +150 -0
- package/skills/applying-slds/metadata/blueprints/components/welcome-mat.yaml +136 -0
- package/skills/applying-slds/metadata/hooks-index.json +6272 -0
- package/skills/applying-slds/metadata/icon-metadata.json +38466 -0
- package/skills/applying-slds/metadata/utilities-index.json +21912 -0
- package/skills/applying-slds/references/component-selection.md +112 -0
- package/skills/applying-slds/references/icons-decision-guide.md +124 -0
- package/skills/applying-slds/references/styling-decision-guide.md +228 -0
- package/skills/applying-slds/references/utilities-quick-ref.md +125 -0
- package/skills/applying-slds/scripts/search-blueprints.cjs +117 -0
- package/skills/applying-slds/scripts/search-hooks.cjs +139 -0
- package/skills/applying-slds/scripts/search-icons.cjs +174 -0
- package/skills/applying-slds/scripts/search-utilities.cjs +161 -0
- package/skills/building-mobile-apps/SKILL.md +0 -1
- package/skills/building-omnistudio-callable-apex/SKILL.md +0 -1
- package/skills/building-omnistudio-datamapper/SKILL.md +0 -1
- package/skills/building-omnistudio-flexcard/SKILL.md +0 -1
- package/skills/building-omnistudio-integration-procedure/SKILL.md +0 -1
- package/skills/building-omnistudio-omniscript/SKILL.md +0 -1
- package/skills/building-sf-integrations/SKILL.md +0 -1
- package/skills/configuring-connected-apps/SKILL.md +0 -1
- package/skills/connecting-datacloud/SKILL.md +0 -1
- package/skills/creating-b2b-commerce-store/SKILL.md +0 -1
- package/skills/debugging-apex-logs/SKILL.md +0 -1
- package/skills/deploying-metadata/SKILL.md +0 -1
- package/skills/deploying-omnistudio-datapacks/SKILL.md +0 -1
- package/skills/developing-agentforce/SKILL.md +0 -1
- package/skills/fetching-salesforce-docs/SKILL.md +0 -1
- package/skills/generating-custom-lightning-type/SKILL.md +17 -39
- package/skills/generating-custom-lightning-type/assets/primitive-types-and-constraints.md +41 -0
- package/skills/generating-custom-lightning-type/references/widget-rendition.md +124 -0
- package/skills/generating-lwc-components/SKILL.md +0 -1
- package/skills/generating-mermaid-diagrams/SKILL.md +0 -1
- package/skills/generating-visual-diagrams/SKILL.md +0 -1
- package/skills/handling-sf-data/SKILL.md +0 -1
- package/skills/harmonizing-datacloud/SKILL.md +0 -1
- package/skills/integrating-b2b-commerce-open-code-components/SKILL.md +0 -1
- package/skills/investigating-agentforce-architecture/README.md +156 -0
- package/skills/investigating-agentforce-architecture/SKILL.md +230 -0
- package/skills/investigating-agentforce-architecture/assets/cli/describe_sobject.yaml +16 -0
- package/skills/investigating-agentforce-architecture/assets/cli/describe_tooling_sobject.yaml +17 -0
- package/skills/investigating-agentforce-architecture/assets/cli/list_metadata_genaiprompttemplate.yaml +17 -0
- package/skills/investigating-agentforce-architecture/assets/cli/org_display.yaml +15 -0
- package/skills/investigating-agentforce-architecture/assets/cli/retrieve_genai_plugin.yaml +18 -0
- package/skills/investigating-agentforce-architecture/assets/cli/show_access_token.yaml +27 -0
- package/skills/investigating-agentforce-architecture/assets/mermaid/action_tree.mmd +20 -0
- package/skills/investigating-agentforce-architecture/assets/mermaid/data_flow.mmd +19 -0
- package/skills/investigating-agentforce-architecture/assets/mermaid/dependency_graph.mmd +19 -0
- package/skills/investigating-agentforce-architecture/assets/mermaid/invocation_sequence.mmd +20 -0
- package/skills/investigating-agentforce-architecture/assets/mermaid/planner_state.mmd +18 -0
- package/skills/investigating-agentforce-architecture/assets/soql/apex_class_bodies_by_ids.soql +3 -0
- package/skills/investigating-agentforce-architecture/assets/soql/apex_class_bodies_by_names.soql +3 -0
- package/skills/investigating-agentforce-architecture/assets/soql/bot_definition_details.soql +3 -0
- package/skills/investigating-agentforce-architecture/assets/soql/bot_version_lookup.soql +4 -0
- package/skills/investigating-agentforce-architecture/assets/soql/flow_definition_by_ids.soql +3 -0
- package/skills/investigating-agentforce-architecture/assets/soql/flow_definition_ids_by_names.soql +3 -0
- package/skills/investigating-agentforce-architecture/assets/soql/flow_definition_view_by_durable_ids.soql +4 -0
- package/skills/investigating-agentforce-architecture/assets/soql/flow_metadata_by_id.soql +3 -0
- package/skills/investigating-agentforce-architecture/assets/soql/functions_by_plugins.soql +5 -0
- package/skills/investigating-agentforce-architecture/assets/soql/planner_attrs_by_parent_ids.soql +3 -0
- package/skills/investigating-agentforce-architecture/assets/soql/planner_bundle_functions.soql +3 -0
- package/skills/investigating-agentforce-architecture/assets/soql/planner_definition_by_agent_chain.soql +3 -0
- package/skills/investigating-agentforce-architecture/assets/soql/plugin_functions_by_plugin_ids.soql +3 -0
- package/skills/investigating-agentforce-architecture/assets/soql/plugin_instructions_by_plugin_ids.soql +3 -0
- package/skills/investigating-agentforce-architecture/assets/soql/plugins_by_planner.soql +4 -0
- package/skills/investigating-agentforce-architecture/references/architecture_sections.md +243 -0
- package/skills/investigating-agentforce-architecture/references/contract.json +244 -0
- package/skills/investigating-agentforce-architecture/references/soql_fields.md +512 -0
- package/skills/investigating-agentforce-architecture/scripts/_shared/__init__.py +1 -0
- package/skills/investigating-agentforce-architecture/scripts/_shared/fs_guard.py +329 -0
- package/skills/investigating-agentforce-architecture/scripts/_shared/paths.py +110 -0
- package/skills/investigating-agentforce-architecture/scripts/_shared/runtime.py +59 -0
- package/skills/investigating-agentforce-architecture/scripts/_shared/sql.py +10 -0
- package/skills/investigating-agentforce-architecture/scripts/cache_check.py +234 -0
- package/skills/investigating-agentforce-architecture/scripts/config.py +131 -0
- package/skills/investigating-agentforce-architecture/scripts/fetch_soql.py +689 -0
- package/skills/investigating-agentforce-architecture/scripts/finalize.py +295 -0
- package/skills/investigating-agentforce-architecture/scripts/main.py +2835 -0
- package/skills/investigating-agentforce-architecture/scripts/metadata_listing.py +265 -0
- package/skills/investigating-agentforce-architecture/scripts/parallel_retrieve.py +69 -0
- package/skills/investigating-agentforce-architecture/scripts/parse_bundle.py +215 -0
- package/skills/investigating-agentforce-architecture/scripts/parse_wave.py +845 -0
- package/skills/investigating-agentforce-architecture/scripts/probe_channels.py +302 -0
- package/skills/investigating-agentforce-architecture/scripts/render_architecture.py +1043 -0
- package/skills/investigating-agentforce-architecture/scripts/resolve_bot.py +255 -0
- package/skills/investigating-agentforce-architecture/scripts/resolve_invocation_target.py +130 -0
- package/skills/investigating-agentforce-architecture/scripts/rest_client.py +763 -0
- package/skills/investigating-agentforce-architecture/scripts/retrieve_planner.py +13 -0
- package/skills/investigating-agentforce-architecture/scripts/sf_cli.py +242 -0
- package/skills/investigating-agentforce-architecture/scripts/soql_loader.py +253 -0
- package/skills/investigating-agentforce-architecture/scripts/summarize_tree.py +143 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/__init__.py +0 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/_bootstrap.py +23 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/fixtures/__init__.py +0 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/fixtures/genai_payloads.py +400 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_cache_check.py +307 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_cache_check_main.py +283 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_config.py +115 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_end_to_end_fixture.py +651 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_finalize.py +278 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_flow_children_inflation.py +582 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_fs_guard.py +113 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_iterative_wave_b.py +478 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_main_pipeline.py +3359 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_parallel_retrieve.py +131 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_parse_bundle.py +400 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_parse_wave.py +644 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_parse_wave_classifiers.py +224 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_parse_wave_helpers.py +380 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_parse_wave_main.py +397 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_per_branch_visited.py +244 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_probe_channels.py +359 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_probe_cli_recipes.py +185 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_render_architecture.py +810 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_resolve_bot.py +203 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_resolve_creds.py +157 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_resolve_invocation_target.py +145 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_rest_client.py +1253 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_runtime_override.py +100 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_sf_cli.py +261 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_signature_stamping.py +466 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_soql_loader.py +501 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_summarize_tree.py +241 -0
- package/skills/investigating-agentforce-architecture/scripts/tests/test_write_emit_ctx.py +480 -0
- package/skills/investigating-agentforce-architecture/tools/emit_env.py +157 -0
- package/skills/investigating-agentforce-architecture/tools/emit_result.py +262 -0
- package/skills/investigating-agentforce-architecture/tools/sanitize.py +33 -0
- package/skills/investigating-agentforce-architecture/tools/write_emit_ctx.py +332 -0
- package/skills/investigating-agentforce-d360/README.md +123 -0
- package/skills/investigating-agentforce-d360/SKILL.md +163 -0
- package/skills/investigating-agentforce-d360/assets/dc/app_generation.sql +51 -0
- package/skills/investigating-agentforce-d360/assets/dc/content_category.sql +44 -0
- package/skills/investigating-agentforce-d360/assets/dc/content_quality.sql +41 -0
- package/skills/investigating-agentforce-d360/assets/dc/discover_sessions.sql +36 -0
- package/skills/investigating-agentforce-d360/assets/dc/feedback.sql +47 -0
- package/skills/investigating-agentforce-d360/assets/dc/feedback_details.sql +38 -0
- package/skills/investigating-agentforce-d360/assets/dc/gateway_records.sql +45 -0
- package/skills/investigating-agentforce-d360/assets/dc/gateway_request_llm.sql +50 -0
- package/skills/investigating-agentforce-d360/assets/dc/gateway_request_metadata.sql +44 -0
- package/skills/investigating-agentforce-d360/assets/dc/gateway_request_tags.sql +42 -0
- package/skills/investigating-agentforce-d360/assets/dc/gateway_requests.sql +89 -0
- package/skills/investigating-agentforce-d360/assets/dc/gateway_responses.sql +43 -0
- package/skills/investigating-agentforce-d360/assets/dc/generations.sql +52 -0
- package/skills/investigating-agentforce-d360/assets/dc/interactions.sql +53 -0
- package/skills/investigating-agentforce-d360/assets/dc/messages.sql +53 -0
- package/skills/investigating-agentforce-d360/assets/dc/messaging_session.sql +37 -0
- package/skills/investigating-agentforce-d360/assets/dc/moment_interactions.sql +34 -0
- package/skills/investigating-agentforce-d360/assets/dc/moments.sql +39 -0
- package/skills/investigating-agentforce-d360/assets/dc/participants.sql +48 -0
- package/skills/investigating-agentforce-d360/assets/dc/sessions.sql +78 -0
- package/skills/investigating-agentforce-d360/assets/dc/steps.sql +64 -0
- package/skills/investigating-agentforce-d360/assets/dc/tag_associations.sql +46 -0
- package/skills/investigating-agentforce-d360/assets/dc/tag_definition_associations.sql +37 -0
- package/skills/investigating-agentforce-d360/assets/dc/tag_definitions.sql +50 -0
- package/skills/investigating-agentforce-d360/assets/dc/tags.sql +37 -0
- package/skills/investigating-agentforce-d360/assets/dc/telemetry_spans.sql +55 -0
- package/skills/investigating-agentforce-d360/references/artifacts.md +50 -0
- package/skills/investigating-agentforce-d360/references/dc_dmo_fields.md +823 -0
- package/skills/investigating-agentforce-d360/references/dc_pipeline_contract.md +608 -0
- package/skills/investigating-agentforce-d360/scripts/_shared/__init__.py +2 -0
- package/skills/investigating-agentforce-d360/scripts/_shared/cli_override.py +98 -0
- package/skills/investigating-agentforce-d360/scripts/_shared/fs_guard.py +334 -0
- package/skills/investigating-agentforce-d360/scripts/_shared/paths.py +155 -0
- package/skills/investigating-agentforce-d360/scripts/_shared/runtime.py +59 -0
- package/skills/investigating-agentforce-d360/scripts/_shared/sql.py +14 -0
- package/skills/investigating-agentforce-d360/scripts/assemble_dc.py +1624 -0
- package/skills/investigating-agentforce-d360/scripts/config.py +45 -0
- package/skills/investigating-agentforce-d360/scripts/dc.py +188 -0
- package/skills/investigating-agentforce-d360/scripts/discover_sessions.py +556 -0
- package/skills/investigating-agentforce-d360/scripts/fetch_dc.py +1045 -0
- package/skills/investigating-agentforce-d360/scripts/render_dc.py +1750 -0
- package/skills/investigating-agentforce-d360/scripts/resolve_session.py +264 -0
- package/skills/investigating-agentforce-d360/scripts/storage.py +92 -0
- package/skills/investigating-agentforce-d360/scripts/tests/__init__.py +0 -0
- package/skills/investigating-agentforce-d360/scripts/tests/_bootstrap.py +15 -0
- package/skills/investigating-agentforce-d360/scripts/tests/fixtures/__init__.py +0 -0
- package/skills/investigating-agentforce-d360/scripts/tests/fixtures/synthetic_session.py +424 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_assemble_dc_bootstrap_and_mode.py +115 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_assemble_dc_gateway_direct.py +220 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_assemble_dc_gateway_direct_integration.py +158 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_assemble_dc_helpers.py +287 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_assemble_dc_integration.py +247 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_dc_and_resolve_session.py +433 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_discover_sessions.py +458 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_discover_sessions_grep_ci.py +193 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_fetch_dc_helpers.py +266 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_fetch_dc_identity.py +528 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_fetch_dc_main.py +251 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_fetch_dc_waterfall.py +229 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_fetch_dc_waterfall_full.py +283 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_identity_coherence.py +327 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_render_dc_branches.py +256 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_render_dc_gateway_direct.py +130 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_render_dc_helpers.py +291 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_render_dc_integration.py +220 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_render_dc_planner_llm_calls.py +284 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_render_dc_show_prompts_gating.py +215 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_resolve_from_disk.py +100 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_resolve_session_main.py +149 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_runtime_override.py +104 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_session_shape.py +95 -0
- package/skills/investigating-agentforce-d360/scripts/tests/test_session_shape_dropped_by_stdm.py +85 -0
- package/skills/managing-managed-event-subscription/SKILL.md +152 -0
- package/skills/managing-managed-event-subscription/assets/managed-event-subscription-template.xml +20 -0
- package/skills/managing-managed-event-subscription/references/delete-guide.md +57 -0
- package/skills/managing-managed-event-subscription/references/topic-name-formats.md +26 -0
- package/skills/managing-managed-event-subscription/references/update-constraints.md +30 -0
- package/skills/modeling-omnistudio-epc-catalog/SKILL.md +0 -1
- package/skills/observing-agentforce/SKILL.md +0 -1
- package/skills/orchestrating-datacloud/SKILL.md +0 -1
- package/skills/preparing-datacloud/SKILL.md +0 -1
- package/skills/querying-soql/SKILL.md +0 -1
- package/skills/retrieving-datacloud/SKILL.md +0 -1
- package/skills/running-apex-tests/SKILL.md +0 -1
- package/skills/running-code-analyzer/SKILL.md +0 -1
- package/skills/segmenting-datacloud/SKILL.md +0 -1
- package/skills/testing-agentforce/SKILL.md +0 -1
- package/skills/uplifting-components-to-slds2/SKILL.md +3 -2
- package/skills/uplifting-components-to-slds2/references/color-hooks-decision-guide.md +30 -9
- package/skills/uplifting-components-to-slds2/references/examples.md +24 -6
- package/skills/validating-slds/SKILL.md +262 -0
- package/skills/validating-slds/references/quality-checks.md +308 -0
- package/skills/validating-slds/references/report-format.md +302 -0
- package/skills/validating-slds/scripts/analyze-quality.cjs +521 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"""Tests for the --data-dir / --cache-dir override mechanism.
|
|
2
|
+
|
|
3
|
+
Three things must be true after ``--data-dir <path>`` is parsed:
|
|
4
|
+
|
|
5
|
+
1. ``paths.DATA_ROOT`` points at the override.
|
|
6
|
+
2. ``config.DATA_ROOT`` points at the override (re-export).
|
|
7
|
+
3. ``main.DATA_ROOT`` points at the override (the local ``from config import
|
|
8
|
+
DATA_ROOT`` snapshot at module top).
|
|
9
|
+
|
|
10
|
+
If any of the three is stale, callers reading ``DATA_ROOT`` from that module
|
|
11
|
+
see the default path. ``main.py:2221`` writes ``str(DATA_ROOT)`` into the
|
|
12
|
+
``.emit_ctx.json`` file consumed by ``emit_result.py`` — getting that wrong
|
|
13
|
+
means the RESULT block points users at the wrong directory.
|
|
14
|
+
"""
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
|
|
19
|
+
from . import _bootstrap # noqa: F401 — sys.path setup
|
|
20
|
+
|
|
21
|
+
import config # type: ignore
|
|
22
|
+
import main # type: ignore
|
|
23
|
+
from _shared import paths, runtime # type: ignore
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _reset_overrides() -> None:
|
|
27
|
+
"""Clear runtime overrides so the test starts from a known state."""
|
|
28
|
+
runtime.set_data_root_override(None)
|
|
29
|
+
runtime.set_cache_root_override(None)
|
|
30
|
+
# Re-resolve all three namespace levels back to defaults.
|
|
31
|
+
default_data = runtime.resolve_data_root("investigating-agentforce-architecture")
|
|
32
|
+
default_cache = runtime.resolve_cache_root("investigating-agentforce-architecture")
|
|
33
|
+
paths.DATA_ROOT = default_data
|
|
34
|
+
paths.CACHE_ROOT = default_cache
|
|
35
|
+
config.DATA_ROOT = default_data
|
|
36
|
+
config.CACHE_ROOT = default_cache
|
|
37
|
+
config.PROBE_CACHE_ROOT = default_cache / "_channel_probe"
|
|
38
|
+
main.DATA_ROOT = default_data
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def test_default_paths_under_vibe() -> None:
|
|
42
|
+
"""No overrides → all 3 namespaces point at ~/.vibe/."""
|
|
43
|
+
_reset_overrides()
|
|
44
|
+
expected_data = Path.home() / ".vibe" / "data" / "investigating-agentforce-architecture"
|
|
45
|
+
expected_cache = Path.home() / ".vibe" / "cache" / "investigating-agentforce-architecture"
|
|
46
|
+
assert paths.DATA_ROOT == expected_data
|
|
47
|
+
assert config.DATA_ROOT == expected_data
|
|
48
|
+
assert main.DATA_ROOT == expected_data
|
|
49
|
+
assert paths.CACHE_ROOT == expected_cache
|
|
50
|
+
assert config.CACHE_ROOT == expected_cache
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def test_data_dir_override_rebinds_three_namespaces(tmp_path: Path) -> None:
|
|
54
|
+
"""--data-dir /tmp/x → all 3 namespaces (paths, config, main) update."""
|
|
55
|
+
_reset_overrides()
|
|
56
|
+
override = tmp_path / "custom-data"
|
|
57
|
+
args = main.parse_args([
|
|
58
|
+
"--org-alias", "myorg",
|
|
59
|
+
"--agent", "MyAgent",
|
|
60
|
+
"--work-dir", str(tmp_path / "work"),
|
|
61
|
+
"--data-dir", str(override),
|
|
62
|
+
])
|
|
63
|
+
main._apply_path_overrides(args)
|
|
64
|
+
# All three namespace levels must equal the override path.
|
|
65
|
+
assert paths.DATA_ROOT == override, "paths.DATA_ROOT not rebound"
|
|
66
|
+
assert config.DATA_ROOT == override, "config.DATA_ROOT not rebound"
|
|
67
|
+
assert main.DATA_ROOT == override, "main.DATA_ROOT not rebound"
|
|
68
|
+
_reset_overrides()
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def test_cache_dir_override_rebinds_paths_and_config(tmp_path: Path) -> None:
|
|
72
|
+
"""--cache-dir /tmp/y → paths.CACHE_ROOT, config.CACHE_ROOT, and PROBE_CACHE_ROOT update."""
|
|
73
|
+
_reset_overrides()
|
|
74
|
+
override = tmp_path / "custom-cache"
|
|
75
|
+
args = main.parse_args([
|
|
76
|
+
"--org-alias", "myorg",
|
|
77
|
+
"--agent", "MyAgent",
|
|
78
|
+
"--work-dir", str(tmp_path / "work"),
|
|
79
|
+
"--cache-dir", str(override),
|
|
80
|
+
])
|
|
81
|
+
main._apply_path_overrides(args)
|
|
82
|
+
assert paths.CACHE_ROOT == override
|
|
83
|
+
assert config.CACHE_ROOT == override
|
|
84
|
+
assert config.PROBE_CACHE_ROOT == override / "_channel_probe"
|
|
85
|
+
_reset_overrides()
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
def test_no_override_leaves_defaults_intact(tmp_path: Path) -> None:
|
|
89
|
+
"""Running with no override flags must not mutate anything."""
|
|
90
|
+
_reset_overrides()
|
|
91
|
+
expected_data = Path.home() / ".vibe" / "data" / "investigating-agentforce-architecture"
|
|
92
|
+
args = main.parse_args([
|
|
93
|
+
"--org-alias", "myorg",
|
|
94
|
+
"--agent", "MyAgent",
|
|
95
|
+
"--work-dir", str(tmp_path / "work"),
|
|
96
|
+
])
|
|
97
|
+
main._apply_path_overrides(args)
|
|
98
|
+
assert paths.DATA_ROOT == expected_data
|
|
99
|
+
assert config.DATA_ROOT == expected_data
|
|
100
|
+
assert main.DATA_ROOT == expected_data
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"""Tests for sf_cli loads YAML with safe_load only.
|
|
2
|
+
|
|
3
|
+
Also covers redaction boundary for stderr content via the local
|
|
4
|
+
_redact_subprocess_stderr helper.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import unittest
|
|
9
|
+
|
|
10
|
+
import yaml
|
|
11
|
+
|
|
12
|
+
from . import _bootstrap # noqa: F401
|
|
13
|
+
|
|
14
|
+
import sf_cli # type: ignore
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class YamlSafeLoadTests(unittest.TestCase):
|
|
18
|
+
"""the bound loader must be identity-equal to yaml.safe_load."""
|
|
19
|
+
|
|
20
|
+
def test_loader_is_yaml_safe_load(self):
|
|
21
|
+
self.assertIs(
|
|
22
|
+
sf_cli._SAFE_LOADER,
|
|
23
|
+
yaml.safe_load,
|
|
24
|
+
"sf_cli must use yaml.safe_load, not yaml.load ",
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
def test_module_docstring_mentions_safe_load(self):
|
|
28
|
+
"""The security contract lives in the docstring; reviewers who
|
|
29
|
+
grep for `yaml.load` in this module should find only the banned
|
|
30
|
+
reference plus the explanation."""
|
|
31
|
+
self.assertIn("yaml.safe_load", sf_cli.__doc__ or "")
|
|
32
|
+
self.assertIn("yaml.load is banned", sf_cli.__doc__ or "")
|
|
33
|
+
|
|
34
|
+
def test_safe_load_rejects_python_object_construction(self):
|
|
35
|
+
"""Sanity check that safe_load actually differs from load —
|
|
36
|
+
an attacker-controlled `!!python/object` tag must raise."""
|
|
37
|
+
malicious = "!!python/object/apply:os.system ['echo pwned']"
|
|
38
|
+
with self.assertRaises(yaml.YAMLError):
|
|
39
|
+
sf_cli._SAFE_LOADER(malicious)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class StderrRedactionTests(unittest.TestCase):
|
|
43
|
+
"""subprocess stderr is redacted before reaching log/exception text."""
|
|
44
|
+
|
|
45
|
+
def test_bearer_token_in_stderr_redacted(self):
|
|
46
|
+
stderr = "Error: API call failed\nAuthorization: Bearer TESTONLY_STDERR_TOKEN\n"
|
|
47
|
+
safe = sf_cli._redact_subprocess_stderr(stderr)
|
|
48
|
+
self.assertNotIn("TESTONLY_STDERR_TOKEN", safe)
|
|
49
|
+
self.assertIn("<redacted>", safe)
|
|
50
|
+
|
|
51
|
+
def test_empty_stderr_returns_empty(self):
|
|
52
|
+
self.assertEqual(sf_cli._redact_subprocess_stderr(""), "")
|
|
53
|
+
self.assertEqual(sf_cli._redact_subprocess_stderr(None), "")
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class ModuleTopImportTests(unittest.TestCase):
|
|
57
|
+
"""`redact_text` is imported at sf_cli module top. If anyone
|
|
58
|
+
re-introduces a lazy `from rest_client import _redact_text` inside
|
|
59
|
+
`_redact_subprocess_stderr`, these tests fail.
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
def test_redact_text_bound_at_module_top(self):
|
|
63
|
+
self.assertTrue(hasattr(sf_cli, "redact_text"))
|
|
64
|
+
# And it's the actual public function, not a stub.
|
|
65
|
+
import rest_client as _rc
|
|
66
|
+
self.assertIs(sf_cli.redact_text, _rc.redact_text)
|
|
67
|
+
|
|
68
|
+
def test_subprocess_stderr_redaction_does_not_import_private(self):
|
|
69
|
+
"""Behavioral proof: redaction works without any lazy import. If
|
|
70
|
+
rest_client.redact_text were renamed and nobody updated sf_cli's
|
|
71
|
+
module-top import, the module would fail to load — an obvious,
|
|
72
|
+
loud failure rather than a silent redaction skip at runtime.
|
|
73
|
+
"""
|
|
74
|
+
stderr = "Authorization: Bearer TOKEN_MUST_NOT_SURVIVE"
|
|
75
|
+
out = sf_cli._redact_subprocess_stderr(stderr)
|
|
76
|
+
self.assertNotIn("TOKEN_MUST_NOT_SURVIVE", out)
|
|
77
|
+
self.assertIn("<redacted>", out)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
class StderrAuthLinePrefixTests(unittest.TestCase):
|
|
81
|
+
"""auth patterns only match on lines starting with Error:/Warning:.
|
|
82
|
+
|
|
83
|
+
Tightens `_stderr_matches_auth` to line-anchored scanning so an
|
|
84
|
+
embedded substring in prose (or a stray Node ESM warning that
|
|
85
|
+
doesn't begin with Error:/Warning:) doesn't false-trigger
|
|
86
|
+
AuthRequired.
|
|
87
|
+
"""
|
|
88
|
+
|
|
89
|
+
PATTERNS = ("NoOrgAuthenticationError", "NamedOrgNotFoundError")
|
|
90
|
+
|
|
91
|
+
def test_error_line_with_pattern_matches(self):
|
|
92
|
+
stderr = "Error: NoOrgAuthenticationError — no org logged in\n"
|
|
93
|
+
self.assertTrue(sf_cli._stderr_matches_auth(stderr, self.PATTERNS))
|
|
94
|
+
|
|
95
|
+
def test_warning_line_with_pattern_matches(self):
|
|
96
|
+
"""Warning-prefixed lines are ALSO in scope per the tightened rule.
|
|
97
|
+
|
|
98
|
+
Some sf CLI plugins emit auth issues as Warning-level diagnostics
|
|
99
|
+
before the hard Error; we don't want to miss those.
|
|
100
|
+
"""
|
|
101
|
+
stderr = "Warning: NoOrgAuthenticationError — auth cache stale\n"
|
|
102
|
+
self.assertTrue(sf_cli._stderr_matches_auth(stderr, self.PATTERNS))
|
|
103
|
+
|
|
104
|
+
def test_embedded_prose_does_not_match(self):
|
|
105
|
+
"""Pattern embedded mid-line without Error:/Warning: prefix → NO match.
|
|
106
|
+
|
|
107
|
+
This is the behavior change: previous substring match would
|
|
108
|
+
have false-positived here.
|
|
109
|
+
"""
|
|
110
|
+
stderr = "see docs for NoOrgAuthenticationError troubleshooting\n"
|
|
111
|
+
self.assertFalse(sf_cli._stderr_matches_auth(stderr, self.PATTERNS))
|
|
112
|
+
|
|
113
|
+
def test_empty_stderr_no_match(self):
|
|
114
|
+
self.assertFalse(sf_cli._stderr_matches_auth("", self.PATTERNS))
|
|
115
|
+
self.assertFalse(sf_cli._stderr_matches_auth(None, self.PATTERNS))
|
|
116
|
+
|
|
117
|
+
def test_multiline_stderr_pattern_on_third_line_matches(self):
|
|
118
|
+
stderr = (
|
|
119
|
+
"Warning: @gthoppae/sf-cli-plugin-data360 is a linked ESM module\n"
|
|
120
|
+
"debug: config loaded\n"
|
|
121
|
+
"Error: NoOrgAuthenticationError — no default org\n"
|
|
122
|
+
)
|
|
123
|
+
self.assertTrue(sf_cli._stderr_matches_auth(stderr, self.PATTERNS))
|
|
124
|
+
|
|
125
|
+
def test_esm_warning_without_auth_pattern_no_match(self):
|
|
126
|
+
"""The exact warning shape we're trying NOT to false-positive on.
|
|
127
|
+
|
|
128
|
+
If a future sf CLI plugin name happened to contain an auth pattern
|
|
129
|
+
substring (unlikely but possible), the line-prefix rule alone
|
|
130
|
+
wouldn't save us. For now, this canonical ESM warning contains no
|
|
131
|
+
auth pattern, so it MUST NOT match.
|
|
132
|
+
"""
|
|
133
|
+
stderr = (
|
|
134
|
+
"Warning: @gthoppae/sf-cli-plugin-data360 is a linked ESM module\n"
|
|
135
|
+
"and will not reload without CLI restart\n"
|
|
136
|
+
)
|
|
137
|
+
self.assertFalse(sf_cli._stderr_matches_auth(stderr, self.PATTERNS))
|
|
138
|
+
|
|
139
|
+
def test_other_prefix_with_pattern_does_not_match(self):
|
|
140
|
+
"""Lines that don't start with Error:/Warning: — even with a pattern
|
|
141
|
+
substring — are filtered out."""
|
|
142
|
+
stderr = "debug: NoOrgAuthenticationError transient\n"
|
|
143
|
+
self.assertFalse(sf_cli._stderr_matches_auth(stderr, self.PATTERNS))
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
class RunSfTests(unittest.TestCase):
|
|
147
|
+
"""Cover ``run_sf`` end-to-end with subprocess mocked.
|
|
148
|
+
|
|
149
|
+
Uses the real ``org_display`` recipe shipped under ``assets/cli/`` so
|
|
150
|
+
the recipe load + arg substitution + auth-pattern config exercise
|
|
151
|
+
real code paths.
|
|
152
|
+
"""
|
|
153
|
+
|
|
154
|
+
from types import SimpleNamespace as _Namespace
|
|
155
|
+
|
|
156
|
+
def _patch_subprocess(self, *, returncode: int = 0,
|
|
157
|
+
stdout: str = '{"status":0,"result":{}}',
|
|
158
|
+
stderr: str = "",
|
|
159
|
+
raise_exc: BaseException | None = None):
|
|
160
|
+
from unittest import mock
|
|
161
|
+
if raise_exc is not None:
|
|
162
|
+
return mock.patch.object(sf_cli.subprocess, "run", side_effect=raise_exc)
|
|
163
|
+
cp = self._Namespace(returncode=returncode, stdout=stdout, stderr=stderr)
|
|
164
|
+
return mock.patch.object(sf_cli.subprocess, "run", return_value=cp)
|
|
165
|
+
|
|
166
|
+
def test_returns_parsed_stdout_on_success(self):
|
|
167
|
+
with self._patch_subprocess():
|
|
168
|
+
data = sf_cli.run_sf("org_display", ORG_ALIAS="my-org")
|
|
169
|
+
self.assertEqual(data, {"status": 0, "result": {}})
|
|
170
|
+
|
|
171
|
+
def test_raises_when_required_param_missing(self):
|
|
172
|
+
with self.assertRaises(sf_cli.SfCliError) as ctx:
|
|
173
|
+
sf_cli.run_sf("org_display") # missing ORG_ALIAS
|
|
174
|
+
self.assertIn("missing required params", str(ctx.exception))
|
|
175
|
+
self.assertIn("ORG_ALIAS", str(ctx.exception))
|
|
176
|
+
|
|
177
|
+
def test_classifies_auth_failure_via_stderr_pattern(self):
|
|
178
|
+
# org_display recipe has NoOrgAuthenticationError in its
|
|
179
|
+
# auth_required_stderr_patterns list.
|
|
180
|
+
with self._patch_subprocess(
|
|
181
|
+
returncode=1,
|
|
182
|
+
stdout='{"status":1}',
|
|
183
|
+
stderr="Error: NoOrgAuthenticationError — no org\n",
|
|
184
|
+
):
|
|
185
|
+
with self.assertRaises(sf_cli.AuthRequired):
|
|
186
|
+
sf_cli.run_sf("org_display", ORG_ALIAS="my-org")
|
|
187
|
+
|
|
188
|
+
def test_raises_sfcli_error_on_nonauth_failure(self):
|
|
189
|
+
with self._patch_subprocess(
|
|
190
|
+
returncode=1,
|
|
191
|
+
stdout='{"status":1}',
|
|
192
|
+
stderr="Error: SomethingElseBlewUp\n",
|
|
193
|
+
):
|
|
194
|
+
with self.assertRaises(sf_cli.SfCliError) as ctx:
|
|
195
|
+
sf_cli.run_sf("org_display", ORG_ALIAS="my-org")
|
|
196
|
+
self.assertIn("exit=1", str(ctx.exception))
|
|
197
|
+
|
|
198
|
+
def test_raises_sfcli_error_on_subprocess_timeout(self):
|
|
199
|
+
import subprocess as _subprocess
|
|
200
|
+
with self._patch_subprocess(
|
|
201
|
+
raise_exc=_subprocess.TimeoutExpired(cmd=["sf"], timeout=1),
|
|
202
|
+
):
|
|
203
|
+
with self.assertRaises(sf_cli.SfCliError) as ctx:
|
|
204
|
+
sf_cli.run_sf("org_display", ORG_ALIAS="my-org")
|
|
205
|
+
self.assertIn("timed out", str(ctx.exception))
|
|
206
|
+
|
|
207
|
+
def test_raises_sfcli_error_when_binary_missing(self):
|
|
208
|
+
# FileNotFoundError = sf binary not on PATH.
|
|
209
|
+
with self._patch_subprocess(raise_exc=FileNotFoundError("sf not found")):
|
|
210
|
+
with self.assertRaises(sf_cli.SfCliError) as ctx:
|
|
211
|
+
sf_cli.run_sf("org_display", ORG_ALIAS="my-org")
|
|
212
|
+
self.assertIn("invocation failed", str(ctx.exception))
|
|
213
|
+
|
|
214
|
+
def test_passes_show_secrets_env_to_subprocess(self):
|
|
215
|
+
"""Tripwire for the W-22582511 sf-CLI-redaction fix.
|
|
216
|
+
|
|
217
|
+
Without ``SF_TEMP_SHOW_SECRETS=true`` in the subprocess env, sf CLI
|
|
218
|
+
v2 returns the literal string ``"[REDACTED] Use 'sf org auth
|
|
219
|
+
show-access-token' to view"`` in place of the bearer token, and
|
|
220
|
+
every downstream Tooling/REST call returns INVALID_AUTH_HEADER 401.
|
|
221
|
+
"""
|
|
222
|
+
from unittest import mock
|
|
223
|
+
captured = {}
|
|
224
|
+
|
|
225
|
+
def fake_run(argv, **kwargs):
|
|
226
|
+
captured["env"] = kwargs.get("env")
|
|
227
|
+
captured["argv"] = argv
|
|
228
|
+
return self._Namespace(
|
|
229
|
+
returncode=0, stdout='{"status":0,"result":{}}', stderr="",
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
with mock.patch.object(sf_cli.subprocess, "run", side_effect=fake_run):
|
|
233
|
+
sf_cli.run_sf("org_display", ORG_ALIAS="my-org")
|
|
234
|
+
|
|
235
|
+
self.assertIsNotNone(captured["env"])
|
|
236
|
+
self.assertEqual(captured["env"].get("SF_TEMP_SHOW_SECRETS"), "true")
|
|
237
|
+
|
|
238
|
+
def test_org_display_recipe_includes_verbose_flag(self):
|
|
239
|
+
"""Tripwire for the W-22582511 ``--verbose`` fix.
|
|
240
|
+
|
|
241
|
+
Without ``--verbose``, sf CLI v2 omits ``accessToken`` from the
|
|
242
|
+
``--json`` output entirely (regardless of SF_TEMP_SHOW_SECRETS),
|
|
243
|
+
so the redaction-env workaround is necessary but not sufficient.
|
|
244
|
+
"""
|
|
245
|
+
from unittest import mock
|
|
246
|
+
captured = {}
|
|
247
|
+
|
|
248
|
+
def fake_run(argv, **kwargs):
|
|
249
|
+
captured["argv"] = argv
|
|
250
|
+
return self._Namespace(
|
|
251
|
+
returncode=0, stdout='{"status":0,"result":{}}', stderr="",
|
|
252
|
+
)
|
|
253
|
+
|
|
254
|
+
with mock.patch.object(sf_cli.subprocess, "run", side_effect=fake_run):
|
|
255
|
+
sf_cli.run_sf("org_display", ORG_ALIAS="my-org")
|
|
256
|
+
|
|
257
|
+
self.assertIn("--verbose", captured["argv"])
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
if __name__ == "__main__":
|
|
261
|
+
unittest.main()
|