@salesforce/afv-skills 1.13.0 → 1.15.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.
Files changed (359) hide show
  1. package/package.json +3 -3
  2. package/skills/applying-slds/SKILL.md +322 -0
  3. package/skills/applying-slds/checklists.md +83 -0
  4. package/skills/applying-slds/examples.md +283 -0
  5. package/skills/applying-slds/guidance/README.md +83 -0
  6. package/skills/applying-slds/guidance/blueprints-index.md +213 -0
  7. package/skills/applying-slds/guidance/icons-guidance.md +186 -0
  8. package/skills/applying-slds/guidance/overviews/borders.md +236 -0
  9. package/skills/applying-slds/guidance/overviews/color.md +266 -0
  10. package/skills/applying-slds/guidance/overviews/display-density.md +366 -0
  11. package/skills/applying-slds/guidance/overviews/icons.md +240 -0
  12. package/skills/applying-slds/guidance/overviews/illustrations.md +235 -0
  13. package/skills/applying-slds/guidance/overviews/shadows.md +176 -0
  14. package/skills/applying-slds/guidance/overviews/spacing.md +216 -0
  15. package/skills/applying-slds/guidance/overviews/typography.md +323 -0
  16. package/skills/applying-slds/guidance/overviews/utilities.md +542 -0
  17. package/skills/applying-slds/guidance/slds-development-guide.md +288 -0
  18. package/skills/applying-slds/guidance/styling-hooks/borders.md +202 -0
  19. package/skills/applying-slds/guidance/styling-hooks/color/expressive-palette-hooks.md +153 -0
  20. package/skills/applying-slds/guidance/styling-hooks/color/index.md +171 -0
  21. package/skills/applying-slds/guidance/styling-hooks/color/semantic/accent-hooks.md +204 -0
  22. package/skills/applying-slds/guidance/styling-hooks/color/semantic/feedback-hooks.md +768 -0
  23. package/skills/applying-slds/guidance/styling-hooks/color/semantic/surface-hooks.md +337 -0
  24. package/skills/applying-slds/guidance/styling-hooks/color/system-hooks.md +132 -0
  25. package/skills/applying-slds/guidance/styling-hooks/index.md +327 -0
  26. package/skills/applying-slds/guidance/styling-hooks/shadows.md +238 -0
  27. package/skills/applying-slds/guidance/styling-hooks/spacing.md +254 -0
  28. package/skills/applying-slds/guidance/styling-hooks/typography.md +448 -0
  29. package/skills/applying-slds/guidance/utilities/alignment.md +119 -0
  30. package/skills/applying-slds/guidance/utilities/borders.md +131 -0
  31. package/skills/applying-slds/guidance/utilities/box.md +125 -0
  32. package/skills/applying-slds/guidance/utilities/color.md +165 -0
  33. package/skills/applying-slds/guidance/utilities/dark-mode.md +111 -0
  34. package/skills/applying-slds/guidance/utilities/description-list.md +168 -0
  35. package/skills/applying-slds/guidance/utilities/floats.md +117 -0
  36. package/skills/applying-slds/guidance/utilities/grid.md +264 -0
  37. package/skills/applying-slds/guidance/utilities/horizontal-list.md +110 -0
  38. package/skills/applying-slds/guidance/utilities/hyphenation.md +84 -0
  39. package/skills/applying-slds/guidance/utilities/index.md +205 -0
  40. package/skills/applying-slds/guidance/utilities/interactions.md +89 -0
  41. package/skills/applying-slds/guidance/utilities/layout.md +109 -0
  42. package/skills/applying-slds/guidance/utilities/line-clamp.md +131 -0
  43. package/skills/applying-slds/guidance/utilities/margin.md +155 -0
  44. package/skills/applying-slds/guidance/utilities/media-object.md +161 -0
  45. package/skills/applying-slds/guidance/utilities/name-value-list.md +152 -0
  46. package/skills/applying-slds/guidance/utilities/padding.md +155 -0
  47. package/skills/applying-slds/guidance/utilities/position.md +177 -0
  48. package/skills/applying-slds/guidance/utilities/print.md +114 -0
  49. package/skills/applying-slds/guidance/utilities/scrollable.md +126 -0
  50. package/skills/applying-slds/guidance/utilities/sizing.md +190 -0
  51. package/skills/applying-slds/guidance/utilities/themes.md +121 -0
  52. package/skills/applying-slds/guidance/utilities/truncate.md +127 -0
  53. package/skills/applying-slds/guidance/utilities/typography.md +166 -0
  54. package/skills/applying-slds/guidance/utilities/vertical-list.md +166 -0
  55. package/skills/applying-slds/guidance/utilities/visibility.md +228 -0
  56. package/skills/applying-slds/metadata/README.md +84 -0
  57. package/skills/applying-slds/metadata/blueprints/components/accordion.yaml +304 -0
  58. package/skills/applying-slds/metadata/blueprints/components/activity-timeline.yaml +92 -0
  59. package/skills/applying-slds/metadata/blueprints/components/alert.yaml +103 -0
  60. package/skills/applying-slds/metadata/blueprints/components/app-launcher.yaml +94 -0
  61. package/skills/applying-slds/metadata/blueprints/components/avatar-group.yaml +81 -0
  62. package/skills/applying-slds/metadata/blueprints/components/avatar.yaml +97 -0
  63. package/skills/applying-slds/metadata/blueprints/components/badges.yaml +102 -0
  64. package/skills/applying-slds/metadata/blueprints/components/brand-band.yaml +198 -0
  65. package/skills/applying-slds/metadata/blueprints/components/breadcrumbs.yaml +95 -0
  66. package/skills/applying-slds/metadata/blueprints/components/builder-header.yaml +192 -0
  67. package/skills/applying-slds/metadata/blueprints/components/button-groups.yaml +82 -0
  68. package/skills/applying-slds/metadata/blueprints/components/button-icons.yaml +295 -0
  69. package/skills/applying-slds/metadata/blueprints/components/buttons.yaml +230 -0
  70. package/skills/applying-slds/metadata/blueprints/components/cards.yaml +124 -0
  71. package/skills/applying-slds/metadata/blueprints/components/carousel.yaml +140 -0
  72. package/skills/applying-slds/metadata/blueprints/components/chat.yaml +179 -0
  73. package/skills/applying-slds/metadata/blueprints/components/checkbox-button-group.yaml +192 -0
  74. package/skills/applying-slds/metadata/blueprints/components/checkbox-button.yaml +204 -0
  75. package/skills/applying-slds/metadata/blueprints/components/checkbox-toggle.yaml +177 -0
  76. package/skills/applying-slds/metadata/blueprints/components/checkbox.yaml +108 -0
  77. package/skills/applying-slds/metadata/blueprints/components/color-picker.yaml +172 -0
  78. package/skills/applying-slds/metadata/blueprints/components/combobox.yaml +136 -0
  79. package/skills/applying-slds/metadata/blueprints/components/counter.yaml +147 -0
  80. package/skills/applying-slds/metadata/blueprints/components/data-tables.yaml +157 -0
  81. package/skills/applying-slds/metadata/blueprints/components/datepickers.yaml +130 -0
  82. package/skills/applying-slds/metadata/blueprints/components/datetime-picker.yaml +155 -0
  83. package/skills/applying-slds/metadata/blueprints/components/docked-composer.yaml +201 -0
  84. package/skills/applying-slds/metadata/blueprints/components/docked-form-footer.yaml +161 -0
  85. package/skills/applying-slds/metadata/blueprints/components/docked-utility-bar.yaml +175 -0
  86. package/skills/applying-slds/metadata/blueprints/components/drop-zone.yaml +115 -0
  87. package/skills/applying-slds/metadata/blueprints/components/dueling-picklist.yaml +196 -0
  88. package/skills/applying-slds/metadata/blueprints/components/dynamic-icons.yaml +128 -0
  89. package/skills/applying-slds/metadata/blueprints/components/dynamic-menu.yaml +141 -0
  90. package/skills/applying-slds/metadata/blueprints/components/expandable-section.yaml +115 -0
  91. package/skills/applying-slds/metadata/blueprints/components/expression.yaml +143 -0
  92. package/skills/applying-slds/metadata/blueprints/components/feeds.yaml +125 -0
  93. package/skills/applying-slds/metadata/blueprints/components/file-selector.yaml +154 -0
  94. package/skills/applying-slds/metadata/blueprints/components/files.yaml +119 -0
  95. package/skills/applying-slds/metadata/blueprints/components/form-element.yaml +145 -0
  96. package/skills/applying-slds/metadata/blueprints/components/global-header.yaml +120 -0
  97. package/skills/applying-slds/metadata/blueprints/components/global-navigation.yaml +100 -0
  98. package/skills/applying-slds/metadata/blueprints/components/icons.yaml +138 -0
  99. package/skills/applying-slds/metadata/blueprints/components/illustration.yaml +205 -0
  100. package/skills/applying-slds/metadata/blueprints/components/input.yaml +151 -0
  101. package/skills/applying-slds/metadata/blueprints/components/list-builder.yaml +127 -0
  102. package/skills/applying-slds/metadata/blueprints/components/lookups.yaml +132 -0
  103. package/skills/applying-slds/metadata/blueprints/components/map.yaml +118 -0
  104. package/skills/applying-slds/metadata/blueprints/components/menus.yaml +134 -0
  105. package/skills/applying-slds/metadata/blueprints/components/modals.yaml +152 -0
  106. package/skills/applying-slds/metadata/blueprints/components/notifications.yaml +88 -0
  107. package/skills/applying-slds/metadata/blueprints/components/page-headers.yaml +135 -0
  108. package/skills/applying-slds/metadata/blueprints/components/panels.yaml +149 -0
  109. package/skills/applying-slds/metadata/blueprints/components/path.yaml +154 -0
  110. package/skills/applying-slds/metadata/blueprints/components/picklist.yaml +125 -0
  111. package/skills/applying-slds/metadata/blueprints/components/pills.yaml +154 -0
  112. package/skills/applying-slds/metadata/blueprints/components/popovers.yaml +120 -0
  113. package/skills/applying-slds/metadata/blueprints/components/progress-bar.yaml +110 -0
  114. package/skills/applying-slds/metadata/blueprints/components/progress-indicator.yaml +133 -0
  115. package/skills/applying-slds/metadata/blueprints/components/progress-ring.yaml +102 -0
  116. package/skills/applying-slds/metadata/blueprints/components/prompt.yaml +126 -0
  117. package/skills/applying-slds/metadata/blueprints/components/publishers.yaml +178 -0
  118. package/skills/applying-slds/metadata/blueprints/components/radio-button-group.yaml +172 -0
  119. package/skills/applying-slds/metadata/blueprints/components/radio-group.yaml +112 -0
  120. package/skills/applying-slds/metadata/blueprints/components/rich-text-editor.yaml +135 -0
  121. package/skills/applying-slds/metadata/blueprints/components/scoped-notifications.yaml +188 -0
  122. package/skills/applying-slds/metadata/blueprints/components/scoped-tabs.yaml +97 -0
  123. package/skills/applying-slds/metadata/blueprints/components/select.yaml +127 -0
  124. package/skills/applying-slds/metadata/blueprints/components/setup-assistant.yaml +152 -0
  125. package/skills/applying-slds/metadata/blueprints/components/slider.yaml +111 -0
  126. package/skills/applying-slds/metadata/blueprints/components/spinners.yaml +135 -0
  127. package/skills/applying-slds/metadata/blueprints/components/split-view.yaml +112 -0
  128. package/skills/applying-slds/metadata/blueprints/components/summary-detail.yaml +103 -0
  129. package/skills/applying-slds/metadata/blueprints/components/tabs.yaml +138 -0
  130. package/skills/applying-slds/metadata/blueprints/components/textarea.yaml +116 -0
  131. package/skills/applying-slds/metadata/blueprints/components/tiles.yaml +108 -0
  132. package/skills/applying-slds/metadata/blueprints/components/timepicker.yaml +111 -0
  133. package/skills/applying-slds/metadata/blueprints/components/toast.yaml +154 -0
  134. package/skills/applying-slds/metadata/blueprints/components/tooltips.yaml +107 -0
  135. package/skills/applying-slds/metadata/blueprints/components/tree-grid.yaml +116 -0
  136. package/skills/applying-slds/metadata/blueprints/components/trees.yaml +116 -0
  137. package/skills/applying-slds/metadata/blueprints/components/trial-bar.yaml +112 -0
  138. package/skills/applying-slds/metadata/blueprints/components/vertical-navigation.yaml +130 -0
  139. package/skills/applying-slds/metadata/blueprints/components/vertical-tabs.yaml +140 -0
  140. package/skills/applying-slds/metadata/blueprints/components/visual-picker.yaml +150 -0
  141. package/skills/applying-slds/metadata/blueprints/components/welcome-mat.yaml +136 -0
  142. package/skills/applying-slds/metadata/hooks-index.json +6272 -0
  143. package/skills/applying-slds/metadata/icon-metadata.json +38466 -0
  144. package/skills/applying-slds/metadata/utilities-index.json +21912 -0
  145. package/skills/applying-slds/references/component-selection.md +112 -0
  146. package/skills/applying-slds/references/icons-decision-guide.md +124 -0
  147. package/skills/applying-slds/references/styling-decision-guide.md +228 -0
  148. package/skills/applying-slds/references/utilities-quick-ref.md +125 -0
  149. package/skills/applying-slds/scripts/search-blueprints.cjs +117 -0
  150. package/skills/applying-slds/scripts/search-hooks.cjs +139 -0
  151. package/skills/applying-slds/scripts/search-icons.cjs +174 -0
  152. package/skills/applying-slds/scripts/search-utilities.cjs +161 -0
  153. package/skills/building-ui-bundle-app/SKILL.md +33 -8
  154. package/skills/generating-custom-application/SKILL.md +1 -1
  155. package/skills/generating-custom-lightning-type/SKILL.md +17 -39
  156. package/skills/generating-custom-lightning-type/assets/primitive-types-and-constraints.md +41 -0
  157. package/skills/generating-custom-lightning-type/references/widget-rendition.md +124 -0
  158. package/skills/generating-ui-bundle-custom-app/SKILL.md +93 -0
  159. package/skills/generating-ui-bundle-custom-app/docs/configure-metadata-custom-application.md +70 -0
  160. package/skills/generating-ui-bundle-metadata/SKILL.md +39 -1
  161. package/skills/investigating-agentforce-architecture/README.md +156 -0
  162. package/skills/investigating-agentforce-architecture/SKILL.md +230 -0
  163. package/skills/investigating-agentforce-architecture/assets/cli/describe_sobject.yaml +16 -0
  164. package/skills/investigating-agentforce-architecture/assets/cli/describe_tooling_sobject.yaml +17 -0
  165. package/skills/investigating-agentforce-architecture/assets/cli/list_metadata_genaiprompttemplate.yaml +17 -0
  166. package/skills/investigating-agentforce-architecture/assets/cli/org_display.yaml +15 -0
  167. package/skills/investigating-agentforce-architecture/assets/cli/retrieve_genai_plugin.yaml +18 -0
  168. package/skills/investigating-agentforce-architecture/assets/cli/show_access_token.yaml +27 -0
  169. package/skills/investigating-agentforce-architecture/assets/mermaid/action_tree.mmd +20 -0
  170. package/skills/investigating-agentforce-architecture/assets/mermaid/data_flow.mmd +19 -0
  171. package/skills/investigating-agentforce-architecture/assets/mermaid/dependency_graph.mmd +19 -0
  172. package/skills/investigating-agentforce-architecture/assets/mermaid/invocation_sequence.mmd +20 -0
  173. package/skills/investigating-agentforce-architecture/assets/mermaid/planner_state.mmd +18 -0
  174. package/skills/investigating-agentforce-architecture/assets/soql/apex_class_bodies_by_ids.soql +3 -0
  175. package/skills/investigating-agentforce-architecture/assets/soql/apex_class_bodies_by_names.soql +3 -0
  176. package/skills/investigating-agentforce-architecture/assets/soql/bot_definition_details.soql +3 -0
  177. package/skills/investigating-agentforce-architecture/assets/soql/bot_version_lookup.soql +4 -0
  178. package/skills/investigating-agentforce-architecture/assets/soql/flow_definition_by_ids.soql +3 -0
  179. package/skills/investigating-agentforce-architecture/assets/soql/flow_definition_ids_by_names.soql +3 -0
  180. package/skills/investigating-agentforce-architecture/assets/soql/flow_definition_view_by_durable_ids.soql +4 -0
  181. package/skills/investigating-agentforce-architecture/assets/soql/flow_metadata_by_id.soql +3 -0
  182. package/skills/investigating-agentforce-architecture/assets/soql/functions_by_plugins.soql +5 -0
  183. package/skills/investigating-agentforce-architecture/assets/soql/planner_attrs_by_parent_ids.soql +3 -0
  184. package/skills/investigating-agentforce-architecture/assets/soql/planner_bundle_functions.soql +3 -0
  185. package/skills/investigating-agentforce-architecture/assets/soql/planner_definition_by_agent_chain.soql +3 -0
  186. package/skills/investigating-agentforce-architecture/assets/soql/plugin_functions_by_plugin_ids.soql +3 -0
  187. package/skills/investigating-agentforce-architecture/assets/soql/plugin_instructions_by_plugin_ids.soql +3 -0
  188. package/skills/investigating-agentforce-architecture/assets/soql/plugins_by_planner.soql +4 -0
  189. package/skills/investigating-agentforce-architecture/references/architecture_sections.md +243 -0
  190. package/skills/investigating-agentforce-architecture/references/contract.json +244 -0
  191. package/skills/investigating-agentforce-architecture/references/soql_fields.md +512 -0
  192. package/skills/investigating-agentforce-architecture/scripts/_shared/__init__.py +1 -0
  193. package/skills/investigating-agentforce-architecture/scripts/_shared/fs_guard.py +329 -0
  194. package/skills/investigating-agentforce-architecture/scripts/_shared/paths.py +110 -0
  195. package/skills/investigating-agentforce-architecture/scripts/_shared/runtime.py +59 -0
  196. package/skills/investigating-agentforce-architecture/scripts/_shared/sql.py +10 -0
  197. package/skills/investigating-agentforce-architecture/scripts/cache_check.py +234 -0
  198. package/skills/investigating-agentforce-architecture/scripts/config.py +131 -0
  199. package/skills/investigating-agentforce-architecture/scripts/fetch_soql.py +689 -0
  200. package/skills/investigating-agentforce-architecture/scripts/finalize.py +295 -0
  201. package/skills/investigating-agentforce-architecture/scripts/main.py +2835 -0
  202. package/skills/investigating-agentforce-architecture/scripts/metadata_listing.py +265 -0
  203. package/skills/investigating-agentforce-architecture/scripts/parallel_retrieve.py +69 -0
  204. package/skills/investigating-agentforce-architecture/scripts/parse_bundle.py +215 -0
  205. package/skills/investigating-agentforce-architecture/scripts/parse_wave.py +845 -0
  206. package/skills/investigating-agentforce-architecture/scripts/probe_channels.py +302 -0
  207. package/skills/investigating-agentforce-architecture/scripts/render_architecture.py +1043 -0
  208. package/skills/investigating-agentforce-architecture/scripts/resolve_bot.py +255 -0
  209. package/skills/investigating-agentforce-architecture/scripts/resolve_invocation_target.py +130 -0
  210. package/skills/investigating-agentforce-architecture/scripts/rest_client.py +763 -0
  211. package/skills/investigating-agentforce-architecture/scripts/retrieve_planner.py +13 -0
  212. package/skills/investigating-agentforce-architecture/scripts/sf_cli.py +242 -0
  213. package/skills/investigating-agentforce-architecture/scripts/soql_loader.py +253 -0
  214. package/skills/investigating-agentforce-architecture/scripts/summarize_tree.py +143 -0
  215. package/skills/investigating-agentforce-architecture/scripts/tests/__init__.py +0 -0
  216. package/skills/investigating-agentforce-architecture/scripts/tests/_bootstrap.py +23 -0
  217. package/skills/investigating-agentforce-architecture/scripts/tests/fixtures/__init__.py +0 -0
  218. package/skills/investigating-agentforce-architecture/scripts/tests/fixtures/genai_payloads.py +400 -0
  219. package/skills/investigating-agentforce-architecture/scripts/tests/test_cache_check.py +307 -0
  220. package/skills/investigating-agentforce-architecture/scripts/tests/test_cache_check_main.py +283 -0
  221. package/skills/investigating-agentforce-architecture/scripts/tests/test_config.py +115 -0
  222. package/skills/investigating-agentforce-architecture/scripts/tests/test_end_to_end_fixture.py +651 -0
  223. package/skills/investigating-agentforce-architecture/scripts/tests/test_finalize.py +278 -0
  224. package/skills/investigating-agentforce-architecture/scripts/tests/test_flow_children_inflation.py +582 -0
  225. package/skills/investigating-agentforce-architecture/scripts/tests/test_fs_guard.py +113 -0
  226. package/skills/investigating-agentforce-architecture/scripts/tests/test_iterative_wave_b.py +478 -0
  227. package/skills/investigating-agentforce-architecture/scripts/tests/test_main_pipeline.py +3359 -0
  228. package/skills/investigating-agentforce-architecture/scripts/tests/test_parallel_retrieve.py +131 -0
  229. package/skills/investigating-agentforce-architecture/scripts/tests/test_parse_bundle.py +400 -0
  230. package/skills/investigating-agentforce-architecture/scripts/tests/test_parse_wave.py +644 -0
  231. package/skills/investigating-agentforce-architecture/scripts/tests/test_parse_wave_classifiers.py +224 -0
  232. package/skills/investigating-agentforce-architecture/scripts/tests/test_parse_wave_helpers.py +380 -0
  233. package/skills/investigating-agentforce-architecture/scripts/tests/test_parse_wave_main.py +397 -0
  234. package/skills/investigating-agentforce-architecture/scripts/tests/test_per_branch_visited.py +244 -0
  235. package/skills/investigating-agentforce-architecture/scripts/tests/test_probe_channels.py +359 -0
  236. package/skills/investigating-agentforce-architecture/scripts/tests/test_probe_cli_recipes.py +185 -0
  237. package/skills/investigating-agentforce-architecture/scripts/tests/test_render_architecture.py +810 -0
  238. package/skills/investigating-agentforce-architecture/scripts/tests/test_resolve_bot.py +203 -0
  239. package/skills/investigating-agentforce-architecture/scripts/tests/test_resolve_creds.py +157 -0
  240. package/skills/investigating-agentforce-architecture/scripts/tests/test_resolve_invocation_target.py +145 -0
  241. package/skills/investigating-agentforce-architecture/scripts/tests/test_rest_client.py +1253 -0
  242. package/skills/investigating-agentforce-architecture/scripts/tests/test_runtime_override.py +100 -0
  243. package/skills/investigating-agentforce-architecture/scripts/tests/test_sf_cli.py +261 -0
  244. package/skills/investigating-agentforce-architecture/scripts/tests/test_signature_stamping.py +466 -0
  245. package/skills/investigating-agentforce-architecture/scripts/tests/test_soql_loader.py +501 -0
  246. package/skills/investigating-agentforce-architecture/scripts/tests/test_summarize_tree.py +241 -0
  247. package/skills/investigating-agentforce-architecture/scripts/tests/test_write_emit_ctx.py +480 -0
  248. package/skills/investigating-agentforce-architecture/tools/emit_env.py +157 -0
  249. package/skills/investigating-agentforce-architecture/tools/emit_result.py +262 -0
  250. package/skills/investigating-agentforce-architecture/tools/sanitize.py +33 -0
  251. package/skills/investigating-agentforce-architecture/tools/write_emit_ctx.py +332 -0
  252. package/skills/investigating-agentforce-d360/README.md +123 -0
  253. package/skills/investigating-agentforce-d360/SKILL.md +163 -0
  254. package/skills/investigating-agentforce-d360/assets/dc/app_generation.sql +51 -0
  255. package/skills/investigating-agentforce-d360/assets/dc/content_category.sql +44 -0
  256. package/skills/investigating-agentforce-d360/assets/dc/content_quality.sql +41 -0
  257. package/skills/investigating-agentforce-d360/assets/dc/discover_sessions.sql +36 -0
  258. package/skills/investigating-agentforce-d360/assets/dc/feedback.sql +47 -0
  259. package/skills/investigating-agentforce-d360/assets/dc/feedback_details.sql +38 -0
  260. package/skills/investigating-agentforce-d360/assets/dc/gateway_records.sql +45 -0
  261. package/skills/investigating-agentforce-d360/assets/dc/gateway_request_llm.sql +50 -0
  262. package/skills/investigating-agentforce-d360/assets/dc/gateway_request_metadata.sql +44 -0
  263. package/skills/investigating-agentforce-d360/assets/dc/gateway_request_tags.sql +42 -0
  264. package/skills/investigating-agentforce-d360/assets/dc/gateway_requests.sql +89 -0
  265. package/skills/investigating-agentforce-d360/assets/dc/gateway_responses.sql +43 -0
  266. package/skills/investigating-agentforce-d360/assets/dc/generations.sql +52 -0
  267. package/skills/investigating-agentforce-d360/assets/dc/interactions.sql +53 -0
  268. package/skills/investigating-agentforce-d360/assets/dc/messages.sql +53 -0
  269. package/skills/investigating-agentforce-d360/assets/dc/messaging_session.sql +37 -0
  270. package/skills/investigating-agentforce-d360/assets/dc/moment_interactions.sql +34 -0
  271. package/skills/investigating-agentforce-d360/assets/dc/moments.sql +39 -0
  272. package/skills/investigating-agentforce-d360/assets/dc/participants.sql +48 -0
  273. package/skills/investigating-agentforce-d360/assets/dc/sessions.sql +78 -0
  274. package/skills/investigating-agentforce-d360/assets/dc/steps.sql +64 -0
  275. package/skills/investigating-agentforce-d360/assets/dc/tag_associations.sql +46 -0
  276. package/skills/investigating-agentforce-d360/assets/dc/tag_definition_associations.sql +37 -0
  277. package/skills/investigating-agentforce-d360/assets/dc/tag_definitions.sql +50 -0
  278. package/skills/investigating-agentforce-d360/assets/dc/tags.sql +37 -0
  279. package/skills/investigating-agentforce-d360/assets/dc/telemetry_spans.sql +55 -0
  280. package/skills/investigating-agentforce-d360/references/artifacts.md +50 -0
  281. package/skills/investigating-agentforce-d360/references/dc_dmo_fields.md +823 -0
  282. package/skills/investigating-agentforce-d360/references/dc_pipeline_contract.md +608 -0
  283. package/skills/investigating-agentforce-d360/scripts/_shared/__init__.py +2 -0
  284. package/skills/investigating-agentforce-d360/scripts/_shared/cli_override.py +98 -0
  285. package/skills/investigating-agentforce-d360/scripts/_shared/fs_guard.py +334 -0
  286. package/skills/investigating-agentforce-d360/scripts/_shared/paths.py +155 -0
  287. package/skills/investigating-agentforce-d360/scripts/_shared/runtime.py +59 -0
  288. package/skills/investigating-agentforce-d360/scripts/_shared/sql.py +14 -0
  289. package/skills/investigating-agentforce-d360/scripts/assemble_dc.py +1624 -0
  290. package/skills/investigating-agentforce-d360/scripts/config.py +45 -0
  291. package/skills/investigating-agentforce-d360/scripts/dc.py +188 -0
  292. package/skills/investigating-agentforce-d360/scripts/discover_sessions.py +556 -0
  293. package/skills/investigating-agentforce-d360/scripts/fetch_dc.py +1045 -0
  294. package/skills/investigating-agentforce-d360/scripts/render_dc.py +1750 -0
  295. package/skills/investigating-agentforce-d360/scripts/resolve_session.py +264 -0
  296. package/skills/investigating-agentforce-d360/scripts/storage.py +92 -0
  297. package/skills/investigating-agentforce-d360/scripts/tests/__init__.py +0 -0
  298. package/skills/investigating-agentforce-d360/scripts/tests/_bootstrap.py +15 -0
  299. package/skills/investigating-agentforce-d360/scripts/tests/fixtures/__init__.py +0 -0
  300. package/skills/investigating-agentforce-d360/scripts/tests/fixtures/synthetic_session.py +424 -0
  301. package/skills/investigating-agentforce-d360/scripts/tests/test_assemble_dc_bootstrap_and_mode.py +115 -0
  302. package/skills/investigating-agentforce-d360/scripts/tests/test_assemble_dc_gateway_direct.py +220 -0
  303. package/skills/investigating-agentforce-d360/scripts/tests/test_assemble_dc_gateway_direct_integration.py +158 -0
  304. package/skills/investigating-agentforce-d360/scripts/tests/test_assemble_dc_helpers.py +287 -0
  305. package/skills/investigating-agentforce-d360/scripts/tests/test_assemble_dc_integration.py +247 -0
  306. package/skills/investigating-agentforce-d360/scripts/tests/test_dc_and_resolve_session.py +433 -0
  307. package/skills/investigating-agentforce-d360/scripts/tests/test_discover_sessions.py +458 -0
  308. package/skills/investigating-agentforce-d360/scripts/tests/test_discover_sessions_grep_ci.py +193 -0
  309. package/skills/investigating-agentforce-d360/scripts/tests/test_fetch_dc_helpers.py +266 -0
  310. package/skills/investigating-agentforce-d360/scripts/tests/test_fetch_dc_identity.py +528 -0
  311. package/skills/investigating-agentforce-d360/scripts/tests/test_fetch_dc_main.py +251 -0
  312. package/skills/investigating-agentforce-d360/scripts/tests/test_fetch_dc_waterfall.py +229 -0
  313. package/skills/investigating-agentforce-d360/scripts/tests/test_fetch_dc_waterfall_full.py +283 -0
  314. package/skills/investigating-agentforce-d360/scripts/tests/test_identity_coherence.py +327 -0
  315. package/skills/investigating-agentforce-d360/scripts/tests/test_render_dc_branches.py +256 -0
  316. package/skills/investigating-agentforce-d360/scripts/tests/test_render_dc_gateway_direct.py +130 -0
  317. package/skills/investigating-agentforce-d360/scripts/tests/test_render_dc_helpers.py +291 -0
  318. package/skills/investigating-agentforce-d360/scripts/tests/test_render_dc_integration.py +220 -0
  319. package/skills/investigating-agentforce-d360/scripts/tests/test_render_dc_planner_llm_calls.py +284 -0
  320. package/skills/investigating-agentforce-d360/scripts/tests/test_render_dc_show_prompts_gating.py +215 -0
  321. package/skills/investigating-agentforce-d360/scripts/tests/test_resolve_from_disk.py +100 -0
  322. package/skills/investigating-agentforce-d360/scripts/tests/test_resolve_session_main.py +149 -0
  323. package/skills/investigating-agentforce-d360/scripts/tests/test_runtime_override.py +104 -0
  324. package/skills/investigating-agentforce-d360/scripts/tests/test_session_shape.py +95 -0
  325. package/skills/investigating-agentforce-d360/scripts/tests/test_session_shape_dropped_by_stdm.py +85 -0
  326. package/skills/managing-managed-event-subscription/SKILL.md +152 -0
  327. package/skills/managing-managed-event-subscription/assets/managed-event-subscription-template.xml +20 -0
  328. package/skills/managing-managed-event-subscription/references/delete-guide.md +57 -0
  329. package/skills/managing-managed-event-subscription/references/topic-name-formats.md +26 -0
  330. package/skills/managing-managed-event-subscription/references/update-constraints.md +30 -0
  331. package/skills/reviewing-lwc-mobile-offline/SKILL.md +168 -0
  332. package/skills/reviewing-lwc-mobile-offline/references/grounding.md +7 -0
  333. package/skills/reviewing-lwc-mobile-offline/references/inline-graphql.md +43 -0
  334. package/skills/reviewing-lwc-mobile-offline/references/komaci-eslint.md +125 -0
  335. package/skills/reviewing-lwc-mobile-offline/references/lwc-if.md +78 -0
  336. package/skills/reviewing-lwc-mobile-offline/scripts/komaci.config.mjs +18 -0
  337. package/skills/reviewing-lwc-mobile-offline/scripts/package.json +10 -0
  338. package/skills/reviewing-lwc-mobile-offline/scripts/run-komaci.sh +69 -0
  339. package/skills/uplifting-components-to-slds2/SKILL.md +3 -2
  340. package/skills/uplifting-components-to-slds2/references/color-hooks-decision-guide.md +30 -9
  341. package/skills/uplifting-components-to-slds2/references/examples.md +24 -6
  342. package/skills/using-mobile-native-capabilities/SKILL.md +182 -0
  343. package/skills/using-mobile-native-capabilities/references/app-review.md +68 -0
  344. package/skills/using-mobile-native-capabilities/references/ar-space-capture.md +125 -0
  345. package/skills/using-mobile-native-capabilities/references/barcode-scanner.md +219 -0
  346. package/skills/using-mobile-native-capabilities/references/base-capability.md +22 -0
  347. package/skills/using-mobile-native-capabilities/references/biometrics.md +90 -0
  348. package/skills/using-mobile-native-capabilities/references/calendar.md +213 -0
  349. package/skills/using-mobile-native-capabilities/references/contacts.md +232 -0
  350. package/skills/using-mobile-native-capabilities/references/document-scanner.md +342 -0
  351. package/skills/using-mobile-native-capabilities/references/geofencing.md +123 -0
  352. package/skills/using-mobile-native-capabilities/references/location.md +158 -0
  353. package/skills/using-mobile-native-capabilities/references/mobile-capabilities.md +30 -0
  354. package/skills/using-mobile-native-capabilities/references/nfc.md +181 -0
  355. package/skills/using-mobile-native-capabilities/references/payments.md +95 -0
  356. package/skills/validating-slds/SKILL.md +262 -0
  357. package/skills/validating-slds/references/quality-checks.md +308 -0
  358. package/skills/validating-slds/references/report-format.md +302 -0
  359. package/skills/validating-slds/scripts/analyze-quality.cjs +521 -0
@@ -0,0 +1,582 @@
1
+ """Tests for `main._build_flow_children` + end-to-end FLOW-child inflation.
2
+
3
+ Closes the Batch-1 placeholder that left `flow_children = {}` unconditionally —
4
+ every FLOW leaf shipped with `children: []` regardless of the subflow /
5
+ actionCall content present in the fetched `Flow.Metadata`.
6
+
7
+ Assertions focus on observable behavior:
8
+ * actionCalls are classified into the correct `kind` + carry `element_name`
9
+ (the flow-XML `<name>` that identifies WHICH Flow element invokes the
10
+ target — load-bearing for the rendered tree view).
11
+ * subflows become `{"kind": "FLOW", ...}` child refs with correct target.
12
+ * The output dict is keyed by FlowDefinition.DeveloperName (what
13
+ `walk_and_inflate` looks up), NOT by ActiveVersionId.
14
+ * Defensive skips on missing ActiveVersionId / missing `Metadata` payload.
15
+ * End-to-end: a mocked Wave B with populated Flow.Metadata produces a tree
16
+ where the FLOW node actually has descendants (the load-bearing integration
17
+ test).
18
+ """
19
+ from __future__ import annotations
20
+
21
+ import json
22
+ import tempfile
23
+ import unittest
24
+ from pathlib import Path
25
+ from unittest import mock
26
+
27
+ from . import _bootstrap # noqa: F401
28
+
29
+ import config # type: ignore
30
+ import soql_loader # type: ignore
31
+ import main # type: ignore
32
+ from tests.fixtures import genai_payloads as fx # type: ignore
33
+
34
+ # Re-point SOQL lookup into the repo source (same recipe as test_main_pipeline).
35
+ _REPO_SOQL_DIR = Path(__file__).resolve().parent.parent.parent / "assets" / "soql"
36
+ config.SOQL_DIR = _REPO_SOQL_DIR
37
+ soql_loader.SOQL_DIR = _REPO_SOQL_DIR
38
+
39
+
40
+ # ---------------------------------------------------------------------------
41
+ # Unit tests — _build_flow_children
42
+ # ---------------------------------------------------------------------------
43
+
44
+
45
+ class BuildFlowChildrenTests(unittest.TestCase):
46
+ def test_actioncalls_classified_correctly(self):
47
+ """Each actionType (apex / generatePromptResponse / other / empty)
48
+ must route through `classify_action_call` and produce the correct
49
+ `kind` + preserve `element_name` + `api_name`."""
50
+ flow_metadata = {
51
+ "301VF001": {
52
+ "Id": "301VF001", "FullName": "MixedFlow-1",
53
+ "Metadata": {
54
+ "actionCalls": [
55
+ {"name": "Call_Apex",
56
+ "actionType": "apex",
57
+ "actionName": "MyApexHandler"},
58
+ {"name": "Generate_Output",
59
+ "actionType": "generatePromptResponse",
60
+ "actionName": "MyPromptTemplate"},
61
+ {"name": "Send_Email",
62
+ "actionType": "emailSimple",
63
+ "actionName": "SendSimpleEmail"},
64
+ {"name": "Unknown_Element",
65
+ "actionType": "",
66
+ "actionName": ""},
67
+ ],
68
+ },
69
+ },
70
+ }
71
+ flow_def_rows = [
72
+ {"Id": "300VF001", "DeveloperName": "MixedFlow",
73
+ "ActiveVersionId": "301VF001"},
74
+ ]
75
+
76
+ out = main._build_flow_children(flow_metadata, flow_def_rows)
77
+ self.assertIn("MixedFlow", out)
78
+ kids = out["MixedFlow"]
79
+ self.assertEqual(len(kids), 4)
80
+
81
+ by_element = {k["element_name"]: k for k in kids}
82
+
83
+ self.assertEqual(by_element["Call_Apex"]["kind"], "APEX")
84
+ self.assertEqual(by_element["Call_Apex"]["api_name"], "MyApexHandler")
85
+
86
+ self.assertEqual(by_element["Generate_Output"]["kind"], "PROMPT_TEMPLATE")
87
+ self.assertEqual(by_element["Generate_Output"]["api_name"], "MyPromptTemplate")
88
+
89
+ self.assertEqual(by_element["Send_Email"]["kind"], "STANDARD_ACTION")
90
+ self.assertEqual(by_element["Send_Email"]["api_name"], "SendSimpleEmail")
91
+ # `invocation_type` (schema 3.1 canonical name) is preserved for
92
+ # STANDARD_ACTION so render layers can surface the actionType
93
+ # qualifier (emailSimple, etc.) — e.g. `SendSimpleEmail (emailSimple)`
94
+ # in the rendered tree.
95
+ self.assertEqual(by_element["Send_Email"]["invocation_type"], "emailSimple")
96
+
97
+ # Empty actionType + empty actionName → UNKNOWN. `classify_action_call`
98
+ # substitutes "?" for the api_name when both are blank.
99
+ self.assertEqual(by_element["Unknown_Element"]["kind"], "UNKNOWN")
100
+
101
+ def test_subflows_become_flow_children(self):
102
+ """Two subflow entries → two `{"kind": "FLOW", ...}` child refs with
103
+ their `<subflows><name>` as `element_name` and `<flowName>` as
104
+ `api_name`. These are the load-bearing fields for the recursive
105
+ inflation step."""
106
+ flow_metadata = {
107
+ "301VF001": {
108
+ "Id": "301VF001", "FullName": "ParentFlow-1",
109
+ "Metadata": {
110
+ "subflows": [
111
+ {"name": "Handle_Fault",
112
+ "flowName": "handleFlowFault"},
113
+ {"name": "Run_Subroutine",
114
+ "flowName": "mySubroutineFlow"},
115
+ ],
116
+ },
117
+ },
118
+ }
119
+ flow_def_rows = [
120
+ {"Id": "300VF001", "DeveloperName": "ParentFlow",
121
+ "ActiveVersionId": "301VF001"},
122
+ ]
123
+
124
+ out = main._build_flow_children(flow_metadata, flow_def_rows)
125
+ kids = out["ParentFlow"]
126
+ self.assertEqual(len(kids), 2)
127
+ self.assertTrue(all(k["kind"] == "FLOW" for k in kids))
128
+
129
+ by_element = {k["element_name"]: k for k in kids}
130
+ self.assertEqual(by_element["Handle_Fault"]["api_name"], "handleFlowFault")
131
+ self.assertEqual(by_element["Run_Subroutine"]["api_name"], "mySubroutineFlow")
132
+
133
+ def test_keyed_by_developer_name_not_version_id(self):
134
+ """The dict MUST be keyed by FlowDefinition.DeveloperName — that's
135
+ what `walk_and_inflate` looks up via `flow_children[leaf.api_name]`.
136
+ Keying by ActiveVersionId would silently return `{}` and the tree
137
+ would stay flat."""
138
+ flow_metadata = {
139
+ "301VF_A": {"Id": "301VF_A", "FullName": "FlowA-1",
140
+ "Metadata": {"actionCalls": [
141
+ {"name": "ac1", "actionType": "apex",
142
+ "actionName": "ApexA"},
143
+ ]}},
144
+ "301VF_B": {"Id": "301VF_B", "FullName": "FlowB-1",
145
+ "Metadata": {"actionCalls": [
146
+ {"name": "ac1", "actionType": "apex",
147
+ "actionName": "ApexB"},
148
+ ]}},
149
+ }
150
+ flow_def_rows = [
151
+ {"Id": "300VF_A", "DeveloperName": "FlowAlpha",
152
+ "ActiveVersionId": "301VF_A"},
153
+ {"Id": "300VF_B", "DeveloperName": "FlowBeta",
154
+ "ActiveVersionId": "301VF_B"},
155
+ ]
156
+ out = main._build_flow_children(flow_metadata, flow_def_rows)
157
+ self.assertEqual(set(out.keys()), {"FlowAlpha", "FlowBeta"})
158
+ # Not the version IDs.
159
+ self.assertNotIn("301VF_A", out)
160
+ self.assertNotIn("301VF_B", out)
161
+
162
+ def test_missing_active_version_id_skipped(self):
163
+ """Inactive flows have no ActiveVersionId. They should be silently
164
+ skipped — not raise KeyError, not pollute `flow_children`."""
165
+ flow_metadata = {
166
+ "301VF001": {"Id": "301VF001", "FullName": "ActiveFlow-1",
167
+ "Metadata": {"actionCalls": []}},
168
+ }
169
+ flow_def_rows = [
170
+ # Active flow: normal row.
171
+ {"Id": "300VF001", "DeveloperName": "ActiveFlow",
172
+ "ActiveVersionId": "301VF001"},
173
+ # Inactive flow: no ActiveVersionId. Must not raise.
174
+ {"Id": "300VF002", "DeveloperName": "InactiveFlow",
175
+ "ActiveVersionId": None},
176
+ ]
177
+ out = main._build_flow_children(flow_metadata, flow_def_rows)
178
+ self.assertIn("ActiveFlow", out)
179
+ self.assertNotIn("InactiveFlow", out)
180
+
181
+ def test_empty_wave_b_produces_empty_dict(self):
182
+ """Zero flows → empty dict, no crash."""
183
+ self.assertEqual(main._build_flow_children({}, []), {})
184
+ self.assertEqual(main._build_flow_children(None or {}, None or []), {})
185
+
186
+ def test_missing_metadata_field_tolerated(self):
187
+ """A Flow record that for some reason lacks `Metadata` (empty dict,
188
+ None, or the key omitted entirely) must degrade to an empty child
189
+ list — never raise. `walk_and_inflate` treats an empty list and
190
+ "no key" identically, so we can be permissive and emit empty lists
191
+ in all three cases; the invariant is "does not raise + does not
192
+ fabricate children"."""
193
+ flow_metadata = {
194
+ "301VF001": {"Id": "301VF001", "FullName": "Empty-1", "Metadata": {}},
195
+ "301VF002": {"Id": "301VF002", "FullName": "None-1", "Metadata": None},
196
+ "301VF003": {"Id": "301VF003", "FullName": "NoKey-1"},
197
+ }
198
+ flow_def_rows = [
199
+ {"Id": "300VF001", "DeveloperName": "EmptyFlow",
200
+ "ActiveVersionId": "301VF001"},
201
+ {"Id": "300VF002", "DeveloperName": "NoneFlow",
202
+ "ActiveVersionId": "301VF002"},
203
+ {"Id": "300VF003", "DeveloperName": "NoKeyFlow",
204
+ "ActiveVersionId": "301VF003"},
205
+ ]
206
+ out = main._build_flow_children(flow_metadata, flow_def_rows)
207
+ for name in ("EmptyFlow", "NoneFlow", "NoKeyFlow"):
208
+ self.assertIn(name, out)
209
+ self.assertEqual(out[name], [])
210
+
211
+ def test_subflow_missing_flow_name_dropped(self):
212
+ """A subflow entry without `flowName` has no api_name to descend
213
+ into — drop it silently rather than emit a broken child ref."""
214
+ flow_metadata = {
215
+ "301VF001": {"Id": "301VF001", "FullName": "Parent-1",
216
+ "Metadata": {"subflows": [
217
+ {"name": "BadSubflow"}, # missing flowName
218
+ {"name": "GoodSubflow", "flowName": "TargetFlow"},
219
+ ]}},
220
+ }
221
+ flow_def_rows = [
222
+ {"Id": "300VF001", "DeveloperName": "ParentFlow",
223
+ "ActiveVersionId": "301VF001"},
224
+ ]
225
+ out = main._build_flow_children(flow_metadata, flow_def_rows)
226
+ self.assertEqual(len(out["ParentFlow"]), 1)
227
+ self.assertEqual(out["ParentFlow"][0]["element_name"], "GoodSubflow")
228
+
229
+
230
+ # ---------------------------------------------------------------------------
231
+ # Integration test — end-to-end tree inflation through _run_parse_wave
232
+ # ---------------------------------------------------------------------------
233
+
234
+
235
+ def _mock_auth_probe():
236
+ org_display_payload = {
237
+ "status": 0,
238
+ "result": {
239
+ "instanceUrl": "https://example.my.salesforce.com",
240
+ "accessToken": "00Dxx0000000000!AQ_fake_token_value",
241
+ "id": "00Dxx0000000000AAA",
242
+ "apiVersion": "60.0",
243
+ },
244
+ }
245
+ return [
246
+ mock.patch.object(main, "run_sf", return_value=org_display_payload),
247
+ mock.patch.object(main, "probe_channels", return_value=fx.probe_ok_payload()),
248
+ ]
249
+
250
+
251
+ def _mock_bot_resolution():
252
+ return [
253
+ mock.patch.object(
254
+ main, "fetch_bot_versions",
255
+ return_value=fx.make_bot_versions("MyAgent", ("v5",), "v5"),
256
+ ),
257
+ mock.patch.object(main, "fetch_bot_definition_details",
258
+ return_value=fx.BOT_DEFINITION_DETAIL_CLASSIC),
259
+ ]
260
+
261
+
262
+ class EndToEndInflationTests(unittest.TestCase):
263
+ """Load-bearing integration test.
264
+
265
+ Runs the full pipeline with a synthetic Flow.Metadata that has one
266
+ actionCall (apex) + one subflow. Asserts the resulting
267
+ `declared_action_tree.json` has a FLOW node whose `children` list
268
+ is NON-empty and carries the expected `element_name`. This is the
269
+ behavior the bug fix restores.
270
+ """
271
+
272
+ def test_end_to_end_inflation_produces_nested_tree(self):
273
+ with tempfile.TemporaryDirectory() as tmp:
274
+ work_dir = Path(tmp) / "work"
275
+ data_root = Path(tmp) / "data"
276
+ cache_root = Path(tmp) / "cache"
277
+
278
+ # Single classic bot with one topic + one flow action. The
279
+ # flow's Metadata carries one actionCall (apex) + one subflow.
280
+ planner = dict(fx.CLASSIC_PLANNER)
281
+ plugins = [{
282
+ "Id": "1VyVF000000TOP1",
283
+ "DeveloperName": "OrderTopic",
284
+ "MasterLabel": "Order Topic",
285
+ "Description": None,
286
+ "PluginType": "Custom",
287
+ "Scope": "Order management",
288
+ "IsLocal": True,
289
+ "CanEscalate": False,
290
+ "Source": "Declarative",
291
+ "ParentId": planner["Id"],
292
+ "LocalDeveloperName": "OrderTopic",
293
+ }]
294
+ functions = [{
295
+ "Id": "1VuVF0000000F01",
296
+ "DeveloperName": "LookupOrderFn",
297
+ "MasterLabel": "LookupOrderFn",
298
+ "Description": None,
299
+ "InvocationTargetType": "flow",
300
+ "InvocationTarget": "LookupOrder",
301
+ "IsLocal": True,
302
+ "IsConfirmationRequired": False,
303
+ "IsIncludeInProgressIndicator": False,
304
+ "ProgressIndicatorMessage": None,
305
+ "Source": "Declarative",
306
+ "PluginId": plugins[0]["Id"],
307
+ "PlannerId": None,
308
+ "ParentId": None,
309
+ "LocalDeveloperName": "LookupOrderFn",
310
+ }]
311
+ plugin_fn_join = [{
312
+ "Id": "pfj1", "PluginId": plugins[0]["Id"],
313
+ "Function": functions[0]["Id"],
314
+ }]
315
+ flow_defs = [{
316
+ "Id": "300VF001", "DeveloperName": "LookupOrder",
317
+ "ActiveVersionId": "301VF001",
318
+ }]
319
+ flow_metadata_record = {
320
+ "Id": "301VF001", "FullName": "LookupOrder-1",
321
+ "Metadata": {
322
+ "actionCalls": [{
323
+ "name": "Call_The_Apex_Helper",
324
+ "actionType": "apex",
325
+ "actionName": "OrderLookupApex",
326
+ }],
327
+ "subflows": [{
328
+ "name": "Run_Subflow",
329
+ "flowName": "OrderLookupSubflow",
330
+ }],
331
+ },
332
+ }
333
+
334
+ patches = [
335
+ *_mock_auth_probe(),
336
+ *_mock_bot_resolution(),
337
+ mock.patch.object(main, "fetch_planner_definition", return_value=planner),
338
+ mock.patch.object(main, "fetch_plugins_by_planner", return_value=plugins),
339
+ mock.patch.object(main, "fetch_planner_bundle_functions", return_value=[]),
340
+ mock.patch.object(main, "fetch_functions_by_plugins",
341
+ return_value=functions),
342
+ mock.patch.object(main, "fetch_plugin_instructions", return_value=[]),
343
+ mock.patch.object(main, "fetch_plugin_functions",
344
+ return_value=plugin_fn_join),
345
+ mock.patch.object(main, "fetch_planner_attrs", return_value=[]),
346
+ mock.patch.object(main, "fetch_apex_bodies_by_names", return_value=[]),
347
+ mock.patch.object(main, "fetch_apex_bodies_by_ids", return_value=[]),
348
+ mock.patch.object(main, "fetch_flow_definition_ids_by_names",
349
+ return_value=flow_defs),
350
+ mock.patch.object(main, "fetch_flow_definition_by_ids", return_value=[]),
351
+ mock.patch.object(
352
+ main, "fetch_flow_metadata",
353
+ side_effect=lambda vid, *a, **kw: (
354
+ flow_metadata_record if vid == "301VF001" else None
355
+ ),
356
+ ),
357
+ mock.patch.object(main, "build_agent_data_dir",
358
+ side_effect=lambda o, a, v: data_root / o / f"{a}__{v}"),
359
+ mock.patch.object(main, "build_agent_cache_dir",
360
+ side_effect=lambda o, a, v: cache_root / o / f"{a}__{v}"),
361
+ ]
362
+ for p in patches:
363
+ p.start()
364
+ try:
365
+ rc = main.main([
366
+ "--org-alias", "test-org",
367
+ "--agent", "MyAgent",
368
+ "--work-dir", str(work_dir),
369
+ "--parallelism", "2",
370
+ ])
371
+ finally:
372
+ for p in patches:
373
+ p.stop()
374
+
375
+ self.assertEqual(rc, 0)
376
+ tree = json.loads((work_dir / "declared_action_tree.json").read_text())
377
+
378
+ # Locate the FLOW leaf under the topic's GEN_AI_FUNCTION.
379
+ topic = tree["root"]["children"][0]
380
+ gen_ai_fn = topic["children"][0]
381
+ flow_leaf = gen_ai_fn["children"][0]
382
+ self.assertEqual(flow_leaf["kind"], "FLOW")
383
+ self.assertEqual(flow_leaf["api_name"], "LookupOrder")
384
+
385
+ # BUG FIX ASSERTION: the FLOW node now has non-empty children.
386
+ # Before the fix, `flow_children = {}` meant every FLOW leaf
387
+ # shipped with `children: []` regardless of actionCalls /
388
+ # subflows content.
389
+ self.assertEqual(len(flow_leaf["children"]), 2)
390
+
391
+ element_names = {c["element_name"] for c in flow_leaf["children"]}
392
+ self.assertIn("Call_The_Apex_Helper", element_names)
393
+ self.assertIn("Run_Subflow", element_names)
394
+
395
+ # Kinds are correctly classified — APEX for the actionCall,
396
+ # FLOW for the subflow.
397
+ by_element = {c["element_name"]: c for c in flow_leaf["children"]}
398
+ self.assertEqual(by_element["Call_The_Apex_Helper"]["kind"], "APEX")
399
+ self.assertEqual(
400
+ by_element["Call_The_Apex_Helper"]["api_name"],
401
+ "OrderLookupApex",
402
+ )
403
+ self.assertEqual(by_element["Run_Subflow"]["kind"], "FLOW")
404
+ self.assertEqual(
405
+ by_element["Run_Subflow"]["api_name"],
406
+ "OrderLookupSubflow",
407
+ )
408
+
409
+ def test_nested_subflow_subtree_populated_via_iteration(self):
410
+ """iterative Wave B must expand shared
411
+ utility-flow leaves.
412
+
413
+ Before the iteration pass: the top-level flow `LookupOrder`
414
+ referenced a subflow `handleFlowFault`, which landed as an empty
415
+ FLOW leaf because its body was never queried. This test pushes
416
+ end-to-end through `main()` and asserts the `handleFlowFault`
417
+ node in the tree has CHILDREN — specifically the Apex class
418
+ `XCSF_FlowFaultMessage` referenced by its own body.
419
+ """
420
+ with tempfile.TemporaryDirectory() as tmp:
421
+ work_dir = Path(tmp) / "work"
422
+ data_root = Path(tmp) / "data"
423
+ cache_root = Path(tmp) / "cache"
424
+
425
+ planner = dict(fx.CLASSIC_PLANNER)
426
+ plugins = [{
427
+ "Id": "1VyVF000000TOP1",
428
+ "DeveloperName": "OrderTopic",
429
+ "MasterLabel": "Order Topic",
430
+ "Description": None,
431
+ "PluginType": "Custom",
432
+ "Scope": "Order management",
433
+ "IsLocal": True,
434
+ "CanEscalate": False,
435
+ "Source": "Declarative",
436
+ "ParentId": planner["Id"],
437
+ "LocalDeveloperName": "OrderTopic",
438
+ }]
439
+ functions = [{
440
+ "Id": "1VuVF0000000F01",
441
+ "DeveloperName": "LookupOrderFn",
442
+ "MasterLabel": "LookupOrderFn",
443
+ "Description": None,
444
+ "InvocationTargetType": "flow",
445
+ "InvocationTarget": "LookupOrder",
446
+ "IsLocal": True,
447
+ "IsConfirmationRequired": False,
448
+ "IsIncludeInProgressIndicator": False,
449
+ "ProgressIndicatorMessage": None,
450
+ "Source": "Declarative",
451
+ "PluginId": plugins[0]["Id"],
452
+ "PlannerId": None,
453
+ "ParentId": None,
454
+ "LocalDeveloperName": "LookupOrderFn",
455
+ }]
456
+ plugin_fn_join = [{
457
+ "Id": "pfj1", "PluginId": plugins[0]["Id"],
458
+ "Function": functions[0]["Id"],
459
+ }]
460
+
461
+ # Flow registry keyed by DeveloperName → (FlowDefinition row,
462
+ # Flow.Metadata record). The mock fetcher consults this on
463
+ # each iteration round.
464
+ flow_registry = {
465
+ "LookupOrder": (
466
+ {"Id": "300VF001", "DeveloperName": "LookupOrder",
467
+ "ActiveVersionId": "301VF001"},
468
+ {"Id": "301VF001", "FullName": "LookupOrder-1",
469
+ "Metadata": {
470
+ "actionCalls": [],
471
+ "subflows": [{
472
+ "name": "Handle_Flow_Fault",
473
+ "flowName": "handleFlowFault",
474
+ }],
475
+ }},
476
+ ),
477
+ "handleFlowFault": (
478
+ {"Id": "300VF002", "DeveloperName": "handleFlowFault",
479
+ "ActiveVersionId": "301VF002"},
480
+ {"Id": "301VF002", "FullName": "handleFlowFault-1",
481
+ "Metadata": {
482
+ "actionCalls": [{
483
+ "name": "Parse_and_log_fault",
484
+ "actionType": "apex",
485
+ "actionName": "XCSF_FlowFaultMessage",
486
+ }],
487
+ "subflows": [],
488
+ }},
489
+ ),
490
+ }
491
+
492
+ def fake_flow_def_by_names(names, *a, **kw):
493
+ return [
494
+ flow_registry[n][0] for n in names if n in flow_registry
495
+ ]
496
+
497
+ def fake_flow_metadata(vid, *a, **kw):
498
+ for _name, (fd, fm) in flow_registry.items():
499
+ if fd["ActiveVersionId"] == vid:
500
+ return fm
501
+ return None
502
+
503
+ # Apex bodies: XCSF_FlowFaultMessage is discovered via the
504
+ # subflow's actionCall in iteration round 2.
505
+ def fake_apex_by_names(names, *a, **kw):
506
+ apex_registry = {
507
+ "XCSF_FlowFaultMessage": {
508
+ "Id": "01pVF001", "Name": "XCSF_FlowFaultMessage",
509
+ "Body": "public class XCSF_FlowFaultMessage { }",
510
+ },
511
+ }
512
+ return [apex_registry[n] for n in names if n in apex_registry]
513
+
514
+ patches = [
515
+ *_mock_auth_probe(),
516
+ *_mock_bot_resolution(),
517
+ mock.patch.object(main, "fetch_planner_definition", return_value=planner),
518
+ mock.patch.object(main, "fetch_plugins_by_planner", return_value=plugins),
519
+ mock.patch.object(main, "fetch_planner_bundle_functions", return_value=[]),
520
+ mock.patch.object(main, "fetch_functions_by_plugins",
521
+ return_value=functions),
522
+ mock.patch.object(main, "fetch_plugin_instructions", return_value=[]),
523
+ mock.patch.object(main, "fetch_plugin_functions",
524
+ return_value=plugin_fn_join),
525
+ mock.patch.object(main, "fetch_planner_attrs", return_value=[]),
526
+ mock.patch.object(main, "fetch_apex_bodies_by_names",
527
+ side_effect=fake_apex_by_names),
528
+ mock.patch.object(main, "fetch_apex_bodies_by_ids", return_value=[]),
529
+ mock.patch.object(main, "fetch_flow_definition_ids_by_names",
530
+ side_effect=fake_flow_def_by_names),
531
+ mock.patch.object(main, "fetch_flow_definition_by_ids", return_value=[]),
532
+ mock.patch.object(main, "fetch_flow_metadata",
533
+ side_effect=fake_flow_metadata),
534
+ mock.patch.object(main, "build_agent_data_dir",
535
+ side_effect=lambda o, a, v: data_root / o / f"{a}__{v}"),
536
+ mock.patch.object(main, "build_agent_cache_dir",
537
+ side_effect=lambda o, a, v: cache_root / o / f"{a}__{v}"),
538
+ ]
539
+ for p in patches:
540
+ p.start()
541
+ try:
542
+ rc = main.main([
543
+ "--org-alias", "test-org",
544
+ "--agent", "MyAgent",
545
+ "--work-dir", str(work_dir),
546
+ "--parallelism", "2",
547
+ ])
548
+ finally:
549
+ for p in patches:
550
+ p.stop()
551
+
552
+ self.assertEqual(rc, 0)
553
+ tree = json.loads((work_dir / "declared_action_tree.json").read_text())
554
+
555
+ topic = tree["root"]["children"][0]
556
+ gen_ai_fn = topic["children"][0]
557
+ top_flow = gen_ai_fn["children"][0]
558
+ self.assertEqual(top_flow["api_name"], "LookupOrder")
559
+
560
+ # LookupOrder → Handle_Flow_Fault (FLOW leaf, pre-iteration
561
+ # this was empty). Post-iteration, it must carry children.
562
+ handle_flow_fault = top_flow["children"][0]
563
+ self.assertEqual(handle_flow_fault["kind"], "FLOW")
564
+ self.assertEqual(handle_flow_fault["api_name"], "handleFlowFault")
565
+
566
+ # Core assertion: the shared utility flow's subtree is now
567
+ # populated via iterative Wave B fetching its body.
568
+ self.assertTrue(
569
+ handle_flow_fault["children"],
570
+ "handleFlowFault subtree is empty — iterative Wave B "
571
+ "did not fetch its body. This is the bug.",
572
+ )
573
+ apex_kids = [
574
+ c for c in handle_flow_fault["children"]
575
+ if c["kind"] == "APEX" and c["api_name"] == "XCSF_FlowFaultMessage"
576
+ ]
577
+ self.assertEqual(len(apex_kids), 1)
578
+ self.assertEqual(apex_kids[0]["element_name"], "Parse_and_log_fault")
579
+
580
+
581
+ if __name__ == "__main__":
582
+ unittest.main()