>, reachable: bool} The screen payload. * @since 1.4.0 */ public static function build(): array { $rows = []; foreach ( SkillRegistry::all() as $skill ) { $rows[] = self::row( $skill ); } return [ 'skills' => $rows, // Whether any of this is reachable at all. `albert/get-skill` is an // ordinary ability an owner can switch off, and doing so suppresses // the entire skills index in the discovery response // ({@see \Albert\Context\Payload::skills()}) — so every skill below // stops reaching every assistant, silently. The screen said nothing // about that, which made a full list of skills a lie. 'reachable' => AbilitiesState::is_enabled( SkillIndex::FETCH_ABILITY ), ]; } /** * Normalise one skill into a row. * * @param Skill $skill The skill. * * @return array The row. * @since 1.4.0 */ private static function row( Skill $skill ): array { $status = $skill->status(); return [ 'slug' => $skill->slug(), 'summary' => $skill->summary(), 'source' => $skill->source(), 'available' => $status['available'], 'status' => $status['label'], 'body' => $skill->body(), ]; } }