@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,251 @@
|
|
|
1
|
+
"""Tests for ``fetch_dc.main`` orchestration.
|
|
2
|
+
|
|
3
|
+
Drives the CLI via ``argv`` patching. Mocks at three boundaries so we
|
|
4
|
+
exercise the orchestration without spawning real DC/HTTP/sf-CLI work:
|
|
5
|
+
|
|
6
|
+
- ``preflight_dc_access`` returns (url, token) or raises DcAccessDenied
|
|
7
|
+
- ``_run_waterfall`` stubbed; mutates ctx the way the real waterfall would
|
|
8
|
+
- ``assemble_dc.main_for_session`` patched to no-op
|
|
9
|
+
- ``render_dc.main_for_session`` patched to no-op
|
|
10
|
+
"""
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
import io
|
|
14
|
+
import json
|
|
15
|
+
import unittest
|
|
16
|
+
from datetime import datetime, timezone
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
from tempfile import TemporaryDirectory
|
|
19
|
+
from unittest import mock
|
|
20
|
+
|
|
21
|
+
from . import _bootstrap # noqa: F401 — sys.path setup
|
|
22
|
+
|
|
23
|
+
import fetch_dc # type: ignore
|
|
24
|
+
from config import paths # type: ignore
|
|
25
|
+
from .fixtures.synthetic_session import IDS, write_to_disk # type: ignore
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def _fake_waterfall(ctx: dict) -> None:
|
|
29
|
+
"""Mutate ctx the way the real waterfall would: stamp identity +
|
|
30
|
+
append a few query entries. Keeps `_write_manifest` happy."""
|
|
31
|
+
ctx["org_id_15"] = IDS.ORG_ID_15
|
|
32
|
+
ctx["agent_api_name"] = IDS.AGENT_API
|
|
33
|
+
ctx["agent_version"] = IDS.AGENT_VERSION
|
|
34
|
+
ctx["session_shape"] = "complete"
|
|
35
|
+
ctx["queries"].append({
|
|
36
|
+
"name": "sessions", "wave": 1, "rows": 1,
|
|
37
|
+
"elapsed_ms": 50, "status": "ok",
|
|
38
|
+
})
|
|
39
|
+
ctx["queries"].append({
|
|
40
|
+
"name": "interactions", "wave": 1, "rows": 3,
|
|
41
|
+
"elapsed_ms": 60, "status": "ok",
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class _MainHarness:
|
|
46
|
+
"""Patch DATA_ROOT + the 4 boundary functions so main() runs offline."""
|
|
47
|
+
|
|
48
|
+
def __init__(self, *, raise_dc_access_denied=None,
|
|
49
|
+
is_tty: bool = False):
|
|
50
|
+
self.raise_dc_access_denied = raise_dc_access_denied
|
|
51
|
+
self.is_tty = is_tty
|
|
52
|
+
|
|
53
|
+
def __enter__(self):
|
|
54
|
+
self._tmp = TemporaryDirectory()
|
|
55
|
+
self._tmpdir = Path(self._tmp.name)
|
|
56
|
+
# Pre-create the session dir so _write_manifest's mkdir works
|
|
57
|
+
# without surprises.
|
|
58
|
+
write_to_disk(self._tmpdir)
|
|
59
|
+
if self.raise_dc_access_denied is not None:
|
|
60
|
+
preflight_mock = mock.patch.object(
|
|
61
|
+
fetch_dc, "preflight_dc_access",
|
|
62
|
+
side_effect=self.raise_dc_access_denied,
|
|
63
|
+
)
|
|
64
|
+
else:
|
|
65
|
+
preflight_mock = mock.patch.object(
|
|
66
|
+
fetch_dc, "preflight_dc_access",
|
|
67
|
+
return_value=("https://example.salesforce.com", "TOKEN"),
|
|
68
|
+
)
|
|
69
|
+
self._patches = [
|
|
70
|
+
mock.patch.object(paths, "DATA_ROOT", self._tmpdir),
|
|
71
|
+
preflight_mock,
|
|
72
|
+
mock.patch.object(fetch_dc, "_run_waterfall",
|
|
73
|
+
side_effect=_fake_waterfall),
|
|
74
|
+
mock.patch("assemble_dc.main_for_session", return_value=0),
|
|
75
|
+
mock.patch("render_dc.main_for_session", return_value=0),
|
|
76
|
+
mock.patch.object(fetch_dc.sys.stdin, "isatty",
|
|
77
|
+
return_value=self.is_tty),
|
|
78
|
+
]
|
|
79
|
+
for p in self._patches:
|
|
80
|
+
p.start()
|
|
81
|
+
return self
|
|
82
|
+
|
|
83
|
+
def __exit__(self, *exc):
|
|
84
|
+
for p in self._patches:
|
|
85
|
+
p.stop()
|
|
86
|
+
self._tmp.cleanup()
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
# -----------------------------------------------------------------------------
|
|
90
|
+
# Happy path
|
|
91
|
+
# -----------------------------------------------------------------------------
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class MainHappyPathTests(unittest.TestCase):
|
|
95
|
+
|
|
96
|
+
def test_main_returns_zero_with_no_assemble_no_render(self):
|
|
97
|
+
with _MainHarness():
|
|
98
|
+
with mock.patch.object(
|
|
99
|
+
fetch_dc.sys, "argv",
|
|
100
|
+
["fetch_dc.py", "--session", IDS.SID, "--org", "my-org",
|
|
101
|
+
"--no-assemble", "--no-render"],
|
|
102
|
+
):
|
|
103
|
+
rc = fetch_dc.main()
|
|
104
|
+
self.assertEqual(rc, 0)
|
|
105
|
+
|
|
106
|
+
def test_main_writes_manifest_under_data_root(self):
|
|
107
|
+
with _MainHarness() as h:
|
|
108
|
+
with mock.patch.object(
|
|
109
|
+
fetch_dc.sys, "argv",
|
|
110
|
+
["fetch_dc.py", "--session", IDS.SID, "--org", "my-org",
|
|
111
|
+
"--no-assemble", "--no-render"],
|
|
112
|
+
):
|
|
113
|
+
fetch_dc.main()
|
|
114
|
+
manifest_path = (
|
|
115
|
+
h._tmpdir
|
|
116
|
+
/ IDS.ORG_ID_15
|
|
117
|
+
/ f"{IDS.AGENT_API}__{IDS.AGENT_VERSION}"
|
|
118
|
+
/ IDS.SID
|
|
119
|
+
/ "dc._session_manifest.json"
|
|
120
|
+
)
|
|
121
|
+
self.assertTrue(manifest_path.is_file())
|
|
122
|
+
manifest = json.loads(manifest_path.read_text())
|
|
123
|
+
self.assertEqual(manifest["session_id"], IDS.SID)
|
|
124
|
+
self.assertEqual(manifest["session_shape"], "complete")
|
|
125
|
+
|
|
126
|
+
def test_main_invokes_assemble_and_render_by_default(self):
|
|
127
|
+
# Without --no-assemble / --no-render, both should be called once.
|
|
128
|
+
with _MainHarness():
|
|
129
|
+
with mock.patch.object(
|
|
130
|
+
fetch_dc.sys, "argv",
|
|
131
|
+
["fetch_dc.py", "--session", IDS.SID, "--org", "my-org"],
|
|
132
|
+
):
|
|
133
|
+
# Re-patch the targets at call site to capture.
|
|
134
|
+
with mock.patch("assemble_dc.main_for_session") as ams:
|
|
135
|
+
with mock.patch("render_dc.main_for_session") as rms:
|
|
136
|
+
rc = fetch_dc.main()
|
|
137
|
+
self.assertEqual(rc, 0)
|
|
138
|
+
ams.assert_called_once_with(IDS.SID)
|
|
139
|
+
rms.assert_called_once_with(IDS.SID)
|
|
140
|
+
|
|
141
|
+
def test_main_skips_assemble_when_flag_set(self):
|
|
142
|
+
with _MainHarness():
|
|
143
|
+
with mock.patch.object(
|
|
144
|
+
fetch_dc.sys, "argv",
|
|
145
|
+
["fetch_dc.py", "--session", IDS.SID, "--org", "my-org",
|
|
146
|
+
"--no-assemble"],
|
|
147
|
+
):
|
|
148
|
+
with mock.patch("assemble_dc.main_for_session") as ams:
|
|
149
|
+
with mock.patch("render_dc.main_for_session") as rms:
|
|
150
|
+
rc = fetch_dc.main()
|
|
151
|
+
self.assertEqual(rc, 0)
|
|
152
|
+
ams.assert_not_called()
|
|
153
|
+
rms.assert_called_once()
|
|
154
|
+
|
|
155
|
+
def test_main_skips_render_when_flag_set(self):
|
|
156
|
+
with _MainHarness():
|
|
157
|
+
with mock.patch.object(
|
|
158
|
+
fetch_dc.sys, "argv",
|
|
159
|
+
["fetch_dc.py", "--session", IDS.SID, "--org", "my-org",
|
|
160
|
+
"--no-render"],
|
|
161
|
+
):
|
|
162
|
+
with mock.patch("assemble_dc.main_for_session") as ams:
|
|
163
|
+
with mock.patch("render_dc.main_for_session") as rms:
|
|
164
|
+
rc = fetch_dc.main()
|
|
165
|
+
self.assertEqual(rc, 0)
|
|
166
|
+
ams.assert_called_once()
|
|
167
|
+
rms.assert_not_called()
|
|
168
|
+
|
|
169
|
+
def test_main_verbose_flag_propagates_to_ctx(self):
|
|
170
|
+
captured_ctx = {}
|
|
171
|
+
|
|
172
|
+
def capture(ctx):
|
|
173
|
+
captured_ctx.update(ctx)
|
|
174
|
+
_fake_waterfall(ctx)
|
|
175
|
+
|
|
176
|
+
with _MainHarness():
|
|
177
|
+
# Override the waterfall mock to capture ctx
|
|
178
|
+
with mock.patch.object(fetch_dc, "_run_waterfall",
|
|
179
|
+
side_effect=capture):
|
|
180
|
+
with mock.patch.object(
|
|
181
|
+
fetch_dc.sys, "argv",
|
|
182
|
+
["fetch_dc.py", "--session", IDS.SID, "--org", "my-org",
|
|
183
|
+
"--verbose", "--no-assemble", "--no-render"],
|
|
184
|
+
):
|
|
185
|
+
fetch_dc.main()
|
|
186
|
+
self.assertTrue(captured_ctx["verbose"])
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
# -----------------------------------------------------------------------------
|
|
190
|
+
# Messaging-id input
|
|
191
|
+
# -----------------------------------------------------------------------------
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
class MainMessagingIdTests(unittest.TestCase):
|
|
195
|
+
|
|
196
|
+
def test_messaging_id_resolves_to_uuid_via_disk(self):
|
|
197
|
+
# Fixture's session row has the messaging id wired up. Patch the
|
|
198
|
+
# resolver at the source module so fetch_dc's lazy import sees it.
|
|
199
|
+
with _MainHarness():
|
|
200
|
+
with mock.patch(
|
|
201
|
+
"resolve_session.resolve_disk_or_live",
|
|
202
|
+
return_value=IDS.SID,
|
|
203
|
+
):
|
|
204
|
+
with mock.patch.object(
|
|
205
|
+
fetch_dc.sys, "argv",
|
|
206
|
+
["fetch_dc.py",
|
|
207
|
+
"--session", "0MwTESTMSG12345AAA",
|
|
208
|
+
"--org", "my-org",
|
|
209
|
+
"--no-assemble", "--no-render"],
|
|
210
|
+
):
|
|
211
|
+
rc = fetch_dc.main()
|
|
212
|
+
self.assertEqual(rc, 0)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
# -----------------------------------------------------------------------------
|
|
216
|
+
# DcAccessDenied → routes through _handle_dc_access_denied
|
|
217
|
+
# -----------------------------------------------------------------------------
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
class MainDcAccessDeniedTests(unittest.TestCase):
|
|
221
|
+
|
|
222
|
+
def test_returns_exit_dc_access_denied_in_headless(self):
|
|
223
|
+
exc = fetch_dc.DcAccessDenied("401", "Unauthorized")
|
|
224
|
+
with _MainHarness(raise_dc_access_denied=exc, is_tty=False):
|
|
225
|
+
with mock.patch.object(
|
|
226
|
+
fetch_dc.sys, "argv",
|
|
227
|
+
["fetch_dc.py", "--session", IDS.SID, "--org", "my-org"],
|
|
228
|
+
):
|
|
229
|
+
with mock.patch("sys.stdout", io.StringIO()):
|
|
230
|
+
rc = fetch_dc.main()
|
|
231
|
+
self.assertEqual(rc, fetch_dc.EXIT_DC_ACCESS_DENIED)
|
|
232
|
+
|
|
233
|
+
def test_returns_exit_dc_access_denied_in_tty_choice_1(self):
|
|
234
|
+
exc = fetch_dc.DcAccessDenied("403", "Forbidden")
|
|
235
|
+
with _MainHarness(raise_dc_access_denied=exc, is_tty=True):
|
|
236
|
+
with mock.patch.object(
|
|
237
|
+
fetch_dc.sys, "argv",
|
|
238
|
+
["fetch_dc.py", "--session", IDS.SID, "--org", "my-org"],
|
|
239
|
+
):
|
|
240
|
+
# Interactive prompt: feed "1" via stdin.
|
|
241
|
+
with mock.patch.object(
|
|
242
|
+
fetch_dc.sys, "stdin",
|
|
243
|
+
io.StringIO("1\n"),
|
|
244
|
+
):
|
|
245
|
+
with mock.patch.object(fetch_dc, "_log"):
|
|
246
|
+
rc = fetch_dc.main()
|
|
247
|
+
self.assertEqual(rc, fetch_dc.EXIT_DC_ACCESS_DENIED)
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
if __name__ == "__main__":
|
|
251
|
+
unittest.main()
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"""Tests for ``fetch_dc`` waterfall building blocks.
|
|
2
|
+
|
|
3
|
+
Covers the per-query helpers and the manifest writer. Doesn't drive the
|
|
4
|
+
full 5-wave waterfall (that's exercised live and the orchestration is
|
|
5
|
+
linear over the small per-query helpers tested here).
|
|
6
|
+
|
|
7
|
+
- ``_classify_session_shape`` pure
|
|
8
|
+
- ``_fetch`` HTTP + storage.save side effects
|
|
9
|
+
- ``_fetch_empty`` no-HTTP record-only
|
|
10
|
+
- ``_write_manifest`` on-disk JSON shape
|
|
11
|
+
"""
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import json
|
|
15
|
+
import unittest
|
|
16
|
+
from datetime import datetime, timezone
|
|
17
|
+
from pathlib import Path
|
|
18
|
+
from tempfile import TemporaryDirectory
|
|
19
|
+
from unittest import mock
|
|
20
|
+
|
|
21
|
+
from . import _bootstrap # noqa: F401 — sys.path setup
|
|
22
|
+
|
|
23
|
+
import fetch_dc # type: ignore
|
|
24
|
+
from config import paths # type: ignore
|
|
25
|
+
from dc import DCQueryError # type: ignore
|
|
26
|
+
from .fixtures.synthetic_session import IDS # type: ignore
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# -----------------------------------------------------------------------------
|
|
30
|
+
# _classify_session_shape — pure
|
|
31
|
+
# -----------------------------------------------------------------------------
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class ClassifySessionShapeTests(unittest.TestCase):
|
|
35
|
+
|
|
36
|
+
def test_session_not_found_when_no_sessions(self):
|
|
37
|
+
out = fetch_dc._classify_session_shape(
|
|
38
|
+
sessions_count=0, steps_total=0,
|
|
39
|
+
llm_step_count=0, gw_req_count=0,
|
|
40
|
+
steps_with_generation_id=0,
|
|
41
|
+
)
|
|
42
|
+
self.assertEqual(out, "session_not_found")
|
|
43
|
+
|
|
44
|
+
def test_interactions_not_materialized_yet_when_gw_present_no_steps(self):
|
|
45
|
+
out = fetch_dc._classify_session_shape(
|
|
46
|
+
sessions_count=1, steps_total=0,
|
|
47
|
+
llm_step_count=0, gw_req_count=2,
|
|
48
|
+
steps_with_generation_id=0,
|
|
49
|
+
)
|
|
50
|
+
self.assertEqual(out, "interactions_not_materialized_yet")
|
|
51
|
+
|
|
52
|
+
def test_abandoned_before_llm_when_steps_present_no_llm(self):
|
|
53
|
+
out = fetch_dc._classify_session_shape(
|
|
54
|
+
sessions_count=1, steps_total=3,
|
|
55
|
+
llm_step_count=0, gw_req_count=0,
|
|
56
|
+
steps_with_generation_id=0,
|
|
57
|
+
)
|
|
58
|
+
self.assertEqual(out, "abandoned_before_llm")
|
|
59
|
+
|
|
60
|
+
def test_planner_ran_no_gateway_logs(self):
|
|
61
|
+
out = fetch_dc._classify_session_shape(
|
|
62
|
+
sessions_count=1, steps_total=3,
|
|
63
|
+
llm_step_count=2, gw_req_count=0,
|
|
64
|
+
steps_with_generation_id=2,
|
|
65
|
+
)
|
|
66
|
+
self.assertEqual(out, "planner_ran_no_gateway_logs")
|
|
67
|
+
|
|
68
|
+
def test_complete_for_normal_session(self):
|
|
69
|
+
out = fetch_dc._classify_session_shape(
|
|
70
|
+
sessions_count=1, steps_total=3,
|
|
71
|
+
llm_step_count=1, gw_req_count=2,
|
|
72
|
+
steps_with_generation_id=1,
|
|
73
|
+
)
|
|
74
|
+
self.assertEqual(out, "complete")
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# -----------------------------------------------------------------------------
|
|
78
|
+
# _fetch — HTTP success / error paths
|
|
79
|
+
# -----------------------------------------------------------------------------
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def _make_ctx(tmpdir: Path) -> dict:
|
|
83
|
+
return {
|
|
84
|
+
"session_id": IDS.SID,
|
|
85
|
+
"org_alias": "my-org",
|
|
86
|
+
"instance_url": "https://example.salesforce.com",
|
|
87
|
+
"token": "TOKEN",
|
|
88
|
+
"verbose": False,
|
|
89
|
+
"queries": [],
|
|
90
|
+
"started_at": datetime.now(timezone.utc),
|
|
91
|
+
"org_id_15": IDS.ORG_ID_15,
|
|
92
|
+
"agent_api_name": IDS.AGENT_API,
|
|
93
|
+
"agent_version": IDS.AGENT_VERSION,
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class FetchHappyPathTests(unittest.TestCase):
|
|
98
|
+
|
|
99
|
+
def test_fetch_records_query_in_manifest_and_saves_rows(self):
|
|
100
|
+
rows = [{"ssot__Id__c": "x"}]
|
|
101
|
+
with TemporaryDirectory() as t:
|
|
102
|
+
with mock.patch.object(paths, "DATA_ROOT", Path(t)):
|
|
103
|
+
ctx = _make_ctx(Path(t))
|
|
104
|
+
with mock.patch.object(fetch_dc, "post", return_value=rows):
|
|
105
|
+
out = fetch_dc._fetch(
|
|
106
|
+
ctx, wave=1, name="sessions",
|
|
107
|
+
where="ssot__Id__c = 'x'",
|
|
108
|
+
)
|
|
109
|
+
self.assertEqual(out, rows)
|
|
110
|
+
self.assertEqual(len(ctx["queries"]), 1)
|
|
111
|
+
entry = ctx["queries"][0]
|
|
112
|
+
self.assertEqual(entry["name"], "sessions")
|
|
113
|
+
self.assertEqual(entry["wave"], 1)
|
|
114
|
+
self.assertEqual(entry["rows"], 1)
|
|
115
|
+
self.assertEqual(entry["status"], "ok")
|
|
116
|
+
|
|
117
|
+
def test_fetch_records_empty_status_when_zero_rows_returned(self):
|
|
118
|
+
with TemporaryDirectory() as t:
|
|
119
|
+
with mock.patch.object(paths, "DATA_ROOT", Path(t)):
|
|
120
|
+
ctx = _make_ctx(Path(t))
|
|
121
|
+
with mock.patch.object(fetch_dc, "post", return_value=[]):
|
|
122
|
+
out = fetch_dc._fetch(
|
|
123
|
+
ctx, wave=1, name="sessions",
|
|
124
|
+
where="ssot__Id__c = 'x'",
|
|
125
|
+
)
|
|
126
|
+
self.assertEqual(out, [])
|
|
127
|
+
self.assertEqual(ctx["queries"][0]["status"], "empty")
|
|
128
|
+
self.assertIn("_unavailable_reason", ctx["queries"][0])
|
|
129
|
+
|
|
130
|
+
def test_fetch_records_join_path_when_provided(self):
|
|
131
|
+
with TemporaryDirectory() as t:
|
|
132
|
+
with mock.patch.object(paths, "DATA_ROOT", Path(t)):
|
|
133
|
+
ctx = _make_ctx(Path(t))
|
|
134
|
+
with mock.patch.object(fetch_dc, "post", return_value=[{"x": 1}]):
|
|
135
|
+
fetch_dc._fetch(
|
|
136
|
+
ctx, wave=2, name="generations",
|
|
137
|
+
where="generationId__c = 'x'",
|
|
138
|
+
join_path="Step.GenerationId__c",
|
|
139
|
+
)
|
|
140
|
+
self.assertEqual(
|
|
141
|
+
ctx["queries"][0]["join_path"], "Step.GenerationId__c",
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
class FetchErrorPathTests(unittest.TestCase):
|
|
146
|
+
|
|
147
|
+
def test_fetch_records_error_status_when_post_raises(self):
|
|
148
|
+
ctx = _make_ctx(Path("/tmp"))
|
|
149
|
+
with mock.patch.object(
|
|
150
|
+
fetch_dc, "post", side_effect=DCQueryError("http=500 ISE\n body"),
|
|
151
|
+
):
|
|
152
|
+
out = fetch_dc._fetch(
|
|
153
|
+
ctx, wave=1, name="sessions",
|
|
154
|
+
where="ssot__Id__c = 'x'",
|
|
155
|
+
)
|
|
156
|
+
self.assertEqual(out, [])
|
|
157
|
+
entry = ctx["queries"][0]
|
|
158
|
+
self.assertEqual(entry["status"], "error")
|
|
159
|
+
self.assertEqual(entry["rows"], 0)
|
|
160
|
+
self.assertIn("http=500 ISE", entry["_unavailable_reason"])
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
# -----------------------------------------------------------------------------
|
|
164
|
+
# _fetch_empty — record-only, no HTTP
|
|
165
|
+
# -----------------------------------------------------------------------------
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
class FetchEmptyTests(unittest.TestCase):
|
|
169
|
+
|
|
170
|
+
def test_fetch_empty_records_skipped_status_with_reason(self):
|
|
171
|
+
ctx = _make_ctx(Path("/tmp"))
|
|
172
|
+
# Should not call HTTP at all.
|
|
173
|
+
with mock.patch.object(fetch_dc, "post") as p:
|
|
174
|
+
fetch_dc._fetch_empty(
|
|
175
|
+
ctx, wave=2, name="generations",
|
|
176
|
+
reason="no parent ids harvested",
|
|
177
|
+
)
|
|
178
|
+
p.assert_not_called()
|
|
179
|
+
entry = ctx["queries"][0]
|
|
180
|
+
self.assertEqual(entry["name"], "generations")
|
|
181
|
+
self.assertEqual(entry["status"], "skipped")
|
|
182
|
+
self.assertEqual(entry["rows"], 0)
|
|
183
|
+
self.assertEqual(
|
|
184
|
+
entry["_unavailable_reason"], "no parent ids harvested",
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
# -----------------------------------------------------------------------------
|
|
189
|
+
# _write_manifest — JSON shape on disk
|
|
190
|
+
# -----------------------------------------------------------------------------
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
class WriteManifestTests(unittest.TestCase):
|
|
194
|
+
|
|
195
|
+
def test_writes_manifest_at_canonical_path(self):
|
|
196
|
+
with TemporaryDirectory() as t:
|
|
197
|
+
with mock.patch.object(paths, "DATA_ROOT", Path(t)):
|
|
198
|
+
ctx = _make_ctx(Path(t))
|
|
199
|
+
ctx["queries"] = [
|
|
200
|
+
{"name": "sessions", "wave": 1, "rows": 1,
|
|
201
|
+
"elapsed_ms": 50, "status": "ok"},
|
|
202
|
+
]
|
|
203
|
+
ctx["session_shape"] = "complete"
|
|
204
|
+
ctx["harvested_ids"] = {"interactions": [IDS.IXN_TURN]}
|
|
205
|
+
fetch_dc._write_manifest(ctx)
|
|
206
|
+
|
|
207
|
+
manifest_path = (
|
|
208
|
+
Path(t)
|
|
209
|
+
/ IDS.ORG_ID_15
|
|
210
|
+
/ f"{IDS.AGENT_API}__{IDS.AGENT_VERSION}"
|
|
211
|
+
/ IDS.SID
|
|
212
|
+
/ "dc._session_manifest.json"
|
|
213
|
+
)
|
|
214
|
+
self.assertTrue(manifest_path.is_file())
|
|
215
|
+
manifest = json.loads(manifest_path.read_text())
|
|
216
|
+
self.assertEqual(manifest["session_id"], IDS.SID)
|
|
217
|
+
self.assertEqual(manifest["org_alias"], "my-org")
|
|
218
|
+
self.assertEqual(manifest["org_id_15"], IDS.ORG_ID_15)
|
|
219
|
+
self.assertEqual(manifest["agent_api_name"], IDS.AGENT_API)
|
|
220
|
+
self.assertEqual(manifest["agent_version"], IDS.AGENT_VERSION)
|
|
221
|
+
self.assertEqual(manifest["session_shape"], "complete")
|
|
222
|
+
self.assertEqual(len(manifest["queries"]), 1)
|
|
223
|
+
self.assertIn("started_at_utc", manifest)
|
|
224
|
+
self.assertIn("finished_at_utc", manifest)
|
|
225
|
+
self.assertIn("elapsed_ms", manifest)
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
if __name__ == "__main__":
|
|
229
|
+
unittest.main()
|