Changeset 3782814 for joinotify/trunk/admin/src/AI/Workflow_Generator.php
- Timestamp:
- 11/03/2026 11:52:29 PM (23 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
joinotify/trunk/admin/src/AI/Workflow_Generator.php
r3771693 r3782814 269 269 * 270 270 * @since 2.0.0 271 * @version 2.7.0 271 272 * @return string 272 273 */ 273 274 protected static function build_actions_reference() { 274 275 $catalog = Registry::get_actions_catalog(); 276 $excluded = self::get_excluded_action_slugs(); 275 277 $lines = array(); 276 278 … … 278 280 $slug = $action['action'] ?? ''; 279 281 280 if ( '' === $slug ) {282 if ( '' === $slug || isset( $excluded[ $slug ] ) ) { 281 283 continue; 282 284 } … … 717 719 * Set of action slugs currently registered in the plugin. 718 720 * 721 * Leaves out the actions the AI may not use (see get_excluded_action_slugs()), so a 722 * generated node of one of them is dropped like a hallucinated slug. 723 * 719 724 * @since 2.1.0 725 * @version 2.7.0 720 726 * @return array<string,bool> Map of slug => true for O(1) lookups. 721 727 */ 722 728 protected static function get_registered_action_slugs() { 723 729 $slugs = array(); 730 $excluded = self::get_excluded_action_slugs(); 724 731 725 732 foreach ( Registry::get_actions_catalog() as $action ) { 726 if ( ! empty( $action['action'] ) ) {733 if ( ! empty( $action['action'] ) && ! isset( $excluded[ (string) $action['action'] ] ) ) { 727 734 $slugs[ (string) $action['action'] ] = true; 728 735 } … … 730 737 731 738 return $slugs; 739 } 740 741 742 /** 743 * Action slugs the AI never puts in a workflow. 744 * 745 * The "HTTP request" action sends the store's data, and a credential, to the address it is 746 * given: a prompt that can steer the model — a product name, a form entry — must not be able 747 * to choose that address. The user adds the node by hand. 748 * 749 * @since 2.7.0 750 * @return array<string,bool> Map of slug => true. 751 */ 752 protected static function get_excluded_action_slugs() { 753 /** 754 * Filter the action slugs the AI workflow generator never uses. 755 * 756 * @since 2.7.0 757 * @param array $slugs 758 */ 759 $slugs = apply_filters( 'Joinotify/AI/Workflow_Generator/Excluded_Actions', array( 'http_request' ) ); 760 761 return array_fill_keys( array_map( 'strval', is_array( $slugs ) ? $slugs : array() ), true ); 732 762 } 733 763
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)