| @@ -105,57 +105,9 @@ | ||
| 105 | 105 | |
| 106 | 106 | return $cast; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | -/** | |
| 110 | - * Ship the agents section config on the WP Explorer window config. | |
| 111 | - * | |
| 112 | - * `enabled` mirrors the `agents` extended option. When it is false the | |
| 113 | - * section still renders — every control disabled, nothing fetched — | |
| 114 | - * and offers `canEnable` users a way into the Features tab that turns | |
| 115 | - * the framework on. `canManage` / `canInvoke` stay the raw capability | |
| 116 | - * answers so that shell renders the same controls it would when the | |
| 117 | - * flag is on, just inert; the real gate is that the REST routes do not | |
| 118 | - * exist while off. | |
| 119 | - * | |
| 120 | - * `aiAvailable` is the cheap structural check (WP 7.0 AI Client + | |
| 121 | - * Abilities API present); whether a connector is actually configured | |
| 122 | - * is probed live by the renderer against `aiStatusUrl`, mirroring the | |
| 123 | - * OS Settings Features tab, so a freshly configured connector is | |
| 124 | - * picked up without a reload. | |
| 125 | - * | |
| 126 | - * `preview` is only sent while the flag is off, which is the only | |
| 127 | - * state that draws it: once Agents is on, the real cast has been | |
| 128 | - * seeded and the grid renders that instead. | |
| 129 | - * | |
| 130 | - * @param array $window_args Args passed to `openstation_register_window()`. | |
| 131 | - * @return array | |
| 132 | - */ | |
| 133 | -function openstation_agents_my_wordpress_window_args( $window_args ) { | |
| 134 | - if ( ! is_array( $window_args ) || ! openstation_agents_user_can_read() ) { | |
| 135 | - return $window_args; | |
| 136 | - } | |
| 137 | - | |
| 138 | - if ( ! isset( $window_args['config'] ) || ! is_array( $window_args['config'] ) ) { | |
| 139 | - $window_args['config'] = array(); | |
| 140 | - } | |
| 141 | - | |
| 142 | - $enabled = openstation_agents_enabled(); | |
| 143 | - | |
| 144 | - $window_args['config']['agents'] = array( | |
| 145 | - 'enabled' => $enabled, | |
| 146 | - 'canEnable' => current_user_can( 'manage_options' ), | |
| 147 | - 'canManage' => openstation_agents_user_can_manage(), | |
| 148 | - 'canInvoke' => openstation_agents_user_can_invoke(), | |
| 149 | - 'aiAvailable' => function_exists( 'openstation_ai_is_available' ) && openstation_ai_is_available(), | |
| 150 | - 'aiStatusUrl' => esc_url_raw( rest_url( 'desktop-mode/v1/ai/status' ) ), | |
| 151 | - 'connectorsUrl' => esc_url_raw( admin_url( 'options-connectors.php' ) ), | |
| 152 | - 'runWindowId' => 'desktop-mode-agent-run', | |
| 153 | - ); | |
| 154 | - | |
| 155 | - if ( ! $enabled ) { | |
| 156 | - $window_args['config']['agents']['preview'] = openstation_agents_preview_cast(); | |
| 157 | - } | |
| 158 | - | |
| 159 | - return $window_args; | |
| 160 | -} | |
| 161 | -add_filter( 'openstation_my_wordpress_window_args', 'openstation_agents_my_wordpress_window_args' ); | |
| 109 | +// (The legacy explorer window's config injection is gone with the | |
| 110 | +// window itself. The explorer APP builds the same section config in | |
| 111 | +// `apps/my-wordpress/parts/agents.php`, over the same | |
| 112 | +// `openstation_agents_*` helpers — `openstation_agents_preview_cast()` | |
| 113 | +// above included.) | |