Add feature tests for QBCore and FiveM tools
- Implement tests for GetInventoryClientFunction and GetInventoryServerFunction in the COX namespace. - Create tests for GenerateManifest and GenerateResourceBoilerplate in the FiveM namespace. - Add tests for event and native function references in the FiveM namespace. - Introduce tests for QBCore client and server event references, functions, and configurations. - Implement tests for shared data retrieval in QBCore. - Ensure all tests validate expected responses and handle edge cases.
This commit is contained in:
25 files changed
+1188
No files matched your search
@@ -26,6 +26,8 @@ use App\Mcp\Tools\QBCore\Client\GetQBCoreClientEventReference;
|
||||
use App\Mcp\Tools\QBCore\Client\GetQBCoreClientFunction;
|
||||
use App\Mcp\Tools\QBCore\GetQBCoreConfig;
|
||||
use App\Mcp\Tools\QBCore\GetQBCorePlayers;
|
||||
use App\Mcp\Tools\QBCore\GetQBCoreResourceList;
|
||||
use App\Mcp\Tools\QBCore\GetQBCoreResourceReference;
|
||||
use App\Mcp\Tools\QBCore\GetQBCoreSharedData;
|
||||
use App\Mcp\Tools\QBCore\Server\GetQBCoreServerEventReference;
|
||||
use App\Mcp\Tools\QBCore\Server\GetQBCoreServerFunction;
|
||||
@@ -66,6 +68,8 @@ class FiveMServer extends Server
|
||||
GetQBCoreSharedData::class,
|
||||
GetQBCoreConfig::class,
|
||||
GetQBCorePlayers::class,
|
||||
GetQBCoreResourceList::class,
|
||||
GetQBCoreResourceReference::class,
|
||||
GetCOXEventReference::class,
|
||||
GetCOXFunction::class,
|
||||
GetInventoryServerFunction::class,
|
||||
|
||||
@@ -0,0 +1,500 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mcp\Tools\QBCore;
|
||||
|
||||
use Illuminate\Contracts\JsonSchema\JsonSchema;
|
||||
use Laravel\Mcp\Request;
|
||||
use Laravel\Mcp\Response;
|
||||
use Laravel\Mcp\Server\Attributes\Description;
|
||||
use Laravel\Mcp\Server\Tool;
|
||||
|
||||
#[Description('Get a complete list of all 58 documented QBCore resources with brief descriptions and categories.')]
|
||||
class GetQBCoreResourceList extends Tool
|
||||
{
|
||||
/**
|
||||
* Handle the tool request.
|
||||
*/
|
||||
public function handle(Request $request): Response
|
||||
{
|
||||
$category = $request->get('category');
|
||||
$resources = $this->getAllResources($category);
|
||||
|
||||
return Response::text($this->formatResourceList($resources));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all QBCore resources, optionally filtered by category.
|
||||
*/
|
||||
protected function getAllResources(?string $category = null): array
|
||||
{
|
||||
$allResources = [
|
||||
// Admin & Management
|
||||
'qb-adminmenu' => [
|
||||
'name' => 'qb-adminmenu',
|
||||
'title' => 'Admin Menu',
|
||||
'category' => 'Admin & Management',
|
||||
'description' => 'Admin panel for server management with player controls, moderation, warnings, and coordinate tools',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-adminmenu',
|
||||
],
|
||||
|
||||
// Jobs
|
||||
'qb-ambulancejob' => [
|
||||
'name' => 'qb-ambulancejob',
|
||||
'title' => 'Ambulance Job',
|
||||
'category' => 'Jobs',
|
||||
'description' => 'Medical job with hospital check-in, damage/bleeding system, and patient revival mechanics',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-ambulancejob',
|
||||
],
|
||||
'qb-busjob' => [
|
||||
'name' => 'qb-busjob',
|
||||
'title' => 'Bus Job',
|
||||
'category' => 'Jobs',
|
||||
'description' => 'Public transportation job for bus drivers with route and payment system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-busjob',
|
||||
],
|
||||
'qb-garbagejob' => [
|
||||
'name' => 'qb-garbagejob',
|
||||
'title' => 'Garbage Job',
|
||||
'category' => 'Jobs',
|
||||
'description' => 'Garbage collection job with pickup routes and payment system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-garbagejob',
|
||||
],
|
||||
'qb-hotdogjob' => [
|
||||
'name' => 'qb-hotdogjob',
|
||||
'title' => 'Hot Dog Job',
|
||||
'category' => 'Jobs',
|
||||
'description' => 'Hot dog stand vendor job with payment system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-hotdogjob',
|
||||
],
|
||||
'qb-mechanicjob' => [
|
||||
'name' => 'qb-mechanicjob',
|
||||
'title' => 'Mechanic Job',
|
||||
'category' => 'Jobs',
|
||||
'description' => 'Vehicle repair and customization job with parts system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-mechanicjob',
|
||||
],
|
||||
'qb-newsjob' => [
|
||||
'name' => 'qb-newsjob',
|
||||
'title' => 'News Job',
|
||||
'category' => 'Jobs',
|
||||
'description' => 'News reporter job with interviews and broadcast system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-newsjob',
|
||||
],
|
||||
'qb-policejob' => [
|
||||
'name' => 'qb-policejob',
|
||||
'title' => 'Police Job',
|
||||
'category' => 'Jobs',
|
||||
'description' => 'Law enforcement job with dispatch, arrest, jailing, and evidence system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-policejob',
|
||||
],
|
||||
'qb-recyclejob' => [
|
||||
'name' => 'qb-recyclejob',
|
||||
'title' => 'Recycle Job',
|
||||
'category' => 'Jobs',
|
||||
'description' => 'Recycling center worker job with item pickup and crafting',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-recyclejob',
|
||||
],
|
||||
'qb-taxijob' => [
|
||||
'name' => 'qb-taxijob',
|
||||
'title' => 'Taxi Job',
|
||||
'category' => 'Jobs',
|
||||
'description' => 'Taxi driver job with passenger pickup and payment system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-taxijob',
|
||||
],
|
||||
'qb-towjob' => [
|
||||
'name' => 'qb-towjob',
|
||||
'title' => 'Tow Job',
|
||||
'category' => 'Jobs',
|
||||
'description' => 'Vehicle towing service with impound and payment system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-towjob',
|
||||
],
|
||||
'qb-truckerjob' => [
|
||||
'name' => 'qb-truckerjob',
|
||||
'title' => 'Trucker Job',
|
||||
'category' => 'Jobs',
|
||||
'description' => 'Long-haul trucking job with delivery routes and payment',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-truckerjob',
|
||||
],
|
||||
|
||||
// Crime & Robberies
|
||||
'qb-bankrobbery' => [
|
||||
'name' => 'qb-bankrobbery',
|
||||
'title' => 'Bank Robbery',
|
||||
'category' => 'Crime & Robberies',
|
||||
'description' => 'Heist job with thermal drill, hacking, and loot system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-bankrobbery',
|
||||
],
|
||||
'qb-drugs' => [
|
||||
'name' => 'qb-drugs',
|
||||
'title' => 'Drug Dealing',
|
||||
'category' => 'Crime & Robberies',
|
||||
'description' => 'Drug production and dealing system with supply and demand',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-drugs',
|
||||
],
|
||||
'qb-houserobbery' => [
|
||||
'name' => 'qb-houserobbery',
|
||||
'title' => 'House Robbery',
|
||||
'category' => 'Crime & Robberies',
|
||||
'description' => 'Residential burglary system with lockpicking and loot',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-houserobbery',
|
||||
],
|
||||
'qb-jewelry' => [
|
||||
'name' => 'qb-jewelry',
|
||||
'title' => 'Jewelry Store Robbery',
|
||||
'category' => 'Crime & Robberies',
|
||||
'description' => 'Jewelry store heist with thermite drill and loot system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-jewelry',
|
||||
],
|
||||
'qb-storerobbery' => [
|
||||
'name' => 'qb-storerobbery',
|
||||
'title' => 'Store Robbery',
|
||||
'category' => 'Crime & Robberies',
|
||||
'description' => 'Convenience store robbery with holdup mechanics',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-storerobbery',
|
||||
],
|
||||
'qb-truckrobbery' => [
|
||||
'name' => 'qb-truckrobbery',
|
||||
'title' => 'Truck Robbery',
|
||||
'category' => 'Crime & Robberies',
|
||||
'description' => 'Armored truck heist with combat and loot mechanics',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-truckrobbery',
|
||||
],
|
||||
'qb-weed' => [
|
||||
'name' => 'qb-weed',
|
||||
'title' => 'Weed Growing',
|
||||
'category' => 'Crime & Robberies',
|
||||
'description' => 'Marijuana cultivation and harvesting system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-weed',
|
||||
],
|
||||
'qb-vineyard' => [
|
||||
'name' => 'qb-vineyard',
|
||||
'title' => 'Vineyard',
|
||||
'category' => 'Crime & Robberies',
|
||||
'description' => 'Grape harvesting and wine production system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-vineyard',
|
||||
],
|
||||
|
||||
// Housing & Interiors
|
||||
'qb-apartments' => [
|
||||
'name' => 'qb-apartments',
|
||||
'title' => 'Apartments',
|
||||
'category' => 'Housing & Interiors',
|
||||
'description' => 'Player apartment rental and management system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-apartments',
|
||||
],
|
||||
'qb-houses' => [
|
||||
'name' => 'qb-houses',
|
||||
'title' => 'Houses',
|
||||
'category' => 'Housing & Interiors',
|
||||
'description' => 'Player house ownership with storage and customization',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-houses',
|
||||
],
|
||||
'qb-interior' => [
|
||||
'name' => 'qb-interior',
|
||||
'title' => 'Interior',
|
||||
'category' => 'Housing & Interiors',
|
||||
'description' => 'Interior world system for building custom rooms',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-interior',
|
||||
],
|
||||
|
||||
// Vehicles & Transportation
|
||||
'qb-garages' => [
|
||||
'name' => 'qb-garages',
|
||||
'title' => 'Garages',
|
||||
'category' => 'Vehicles & Transportation',
|
||||
'description' => 'Vehicle parking and retrieval system with multiple garages',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-garages',
|
||||
],
|
||||
'qb-vehiclekeys' => [
|
||||
'name' => 'qb-vehiclekeys',
|
||||
'title' => 'Vehicle Keys',
|
||||
'category' => 'Vehicles & Transportation',
|
||||
'description' => 'Vehicle ownership and key distribution system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-vehiclekeys',
|
||||
],
|
||||
'qb-vehiclesales' => [
|
||||
'name' => 'qb-vehiclesales',
|
||||
'title' => 'Vehicle Sales',
|
||||
'category' => 'Vehicles & Transportation',
|
||||
'description' => 'Vehicle dealership system for buying and trading vehicles',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-vehiclesales',
|
||||
],
|
||||
'qb-vehicleshop' => [
|
||||
'name' => 'qb-vehicleshop',
|
||||
'title' => 'Vehicle Shop',
|
||||
'category' => 'Vehicles & Transportation',
|
||||
'description' => 'Show room for purchasing new vehicles',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-vehicleshop',
|
||||
],
|
||||
'qb-fuel' => [
|
||||
'name' => 'qb-fuel',
|
||||
'title' => 'Fuel System',
|
||||
'category' => 'Vehicles & Transportation',
|
||||
'description' => 'Vehicle fueling system with gas stations',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-fuel',
|
||||
],
|
||||
|
||||
// Commerce & Markets
|
||||
'qb-banking' => [
|
||||
'name' => 'qb-banking',
|
||||
'title' => 'Banking',
|
||||
'category' => 'Commerce & Markets',
|
||||
'description' => 'Bank account system with deposits, withdrawals, and transfers',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-banking',
|
||||
],
|
||||
'qb-cityhall' => [
|
||||
'name' => 'qb-cityhall',
|
||||
'title' => 'City Hall',
|
||||
'category' => 'Commerce & Markets',
|
||||
'description' => 'Government records and ID system for players',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-cityhall',
|
||||
],
|
||||
'qb-clothing' => [
|
||||
'name' => 'qb-clothing',
|
||||
'title' => 'Clothing Shop',
|
||||
'category' => 'Commerce & Markets',
|
||||
'description' => 'Clothing store system for outfit customization',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-clothing',
|
||||
],
|
||||
'qb-crypto' => [
|
||||
'name' => 'qb-crypto',
|
||||
'title' => 'Cryptocurrency',
|
||||
'category' => 'Commerce & Markets',
|
||||
'description' => 'Cryptocurrency trading platform system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-crypto',
|
||||
],
|
||||
'qb-pawnshop' => [
|
||||
'name' => 'qb-pawnshop',
|
||||
'title' => 'Pawn Shop',
|
||||
'category' => 'Commerce & Markets',
|
||||
'description' => 'Pawn shop for selling and buying items',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-pawnshop',
|
||||
],
|
||||
'qb-shops' => [
|
||||
'name' => 'qb-shops',
|
||||
'title' => 'Shops',
|
||||
'category' => 'Commerce & Markets',
|
||||
'description' => 'General-purpose shop system for generic stores',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-shops',
|
||||
],
|
||||
|
||||
// Player Systems
|
||||
'qb-inventory' => [
|
||||
'name' => 'qb-inventory',
|
||||
'title' => 'Inventory',
|
||||
'category' => 'Player Systems',
|
||||
'description' => 'Player item inventory management system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-inventory',
|
||||
],
|
||||
'qb-management' => [
|
||||
'name' => 'qb-management',
|
||||
'title' => 'Management',
|
||||
'category' => 'Player Systems',
|
||||
'description' => 'Org/faction/job management system for player hierarchies',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-management',
|
||||
],
|
||||
'qb-multicharacter' => [
|
||||
'name' => 'qb-multicharacter',
|
||||
'title' => 'Multi-Character',
|
||||
'category' => 'Player Systems',
|
||||
'description' => 'Multiple character selection and management on login',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-multicharacter',
|
||||
],
|
||||
'qb-phone' => [
|
||||
'name' => 'qb-phone',
|
||||
'title' => 'Phone',
|
||||
'category' => 'Player Systems',
|
||||
'description' => 'In-game phone system with apps, messages, and calls',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-phone',
|
||||
],
|
||||
'qb-prison' => [
|
||||
'name' => 'qb-prison',
|
||||
'title' => 'Prison',
|
||||
'category' => 'Player Systems',
|
||||
'description' => 'Prison system for jailed players with tasks and release',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-prison',
|
||||
],
|
||||
'qb-spawn' => [
|
||||
'name' => 'qb-spawn',
|
||||
'title' => 'Spawn',
|
||||
'category' => 'Player Systems',
|
||||
'description' => 'Initial spawn location selector for new players',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-spawn',
|
||||
],
|
||||
'qb-fitbit' => [
|
||||
'name' => 'qb-fitbit',
|
||||
'title' => 'Fitbit',
|
||||
'category' => 'Player Systems',
|
||||
'description' => 'Health and fitness tracking wearable device',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-fitbit',
|
||||
],
|
||||
|
||||
// UI & Interface
|
||||
'qb-hud' => [
|
||||
'name' => 'qb-hud',
|
||||
'title' => 'HUD',
|
||||
'category' => 'UI & Interface',
|
||||
'description' => 'Main heads-up display for player information',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-hud',
|
||||
],
|
||||
'qb-input' => [
|
||||
'name' => 'qb-input',
|
||||
'title' => 'Input',
|
||||
'category' => 'UI & Interface',
|
||||
'description' => 'Generic input dialog system for NUI popups',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-input',
|
||||
],
|
||||
'qb-loading' => [
|
||||
'name' => 'qb-loading',
|
||||
'title' => 'Loading Screen',
|
||||
'category' => 'UI & Interface',
|
||||
'description' => 'Animated loading screen on server startup',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-loading',
|
||||
],
|
||||
'qb-menu' => [
|
||||
'name' => 'qb-menu',
|
||||
'title' => 'Menu',
|
||||
'category' => 'UI & Interface',
|
||||
'description' => 'Simple menu UI system for player interactions',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-menu',
|
||||
],
|
||||
'qb-radialmenu' => [
|
||||
'name' => 'qb-radialmenu',
|
||||
'title' => 'Radial Menu',
|
||||
'category' => 'UI & Interface',
|
||||
'description' => 'Radial/circular menu interface for quick selections',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-radialmenu',
|
||||
],
|
||||
'qb-scoreboard' => [
|
||||
'name' => 'qb-scoreboard',
|
||||
'title' => 'Scoreboard',
|
||||
'category' => 'UI & Interface',
|
||||
'description' => 'Server player list and information scoreboard',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-scoreboard',
|
||||
],
|
||||
'qb-target' => [
|
||||
'name' => 'qb-target',
|
||||
'title' => 'Target System',
|
||||
'category' => 'UI & Interface',
|
||||
'description' => 'NPC and object targeting system for interactions',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-target',
|
||||
],
|
||||
|
||||
// Entertainment & Activities
|
||||
'qb-diving' => [
|
||||
'name' => 'qb-diving',
|
||||
'title' => 'Diving',
|
||||
'category' => 'Entertainment & Activities',
|
||||
'description' => 'Underwater treasure hunting activity',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-diving',
|
||||
],
|
||||
'qb-lapraces' => [
|
||||
'name' => 'qb-lapraces',
|
||||
'title' => 'Lap Races',
|
||||
'category' => 'Entertainment & Activities',
|
||||
'description' => 'Racing competition system with lap tracking',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-lapraces',
|
||||
],
|
||||
'qb-minigames' => [
|
||||
'name' => 'qb-minigames',
|
||||
'title' => 'Minigames',
|
||||
'category' => 'Entertainment & Activities',
|
||||
'description' => 'Collection of minigames for lockpicking, hacking, etc.',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-minigames',
|
||||
],
|
||||
'qb-radio' => [
|
||||
'name' => 'qb-radio',
|
||||
'title' => 'Radio',
|
||||
'category' => 'Entertainment & Activities',
|
||||
'description' => 'In-vehicle or ambient radio station system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-radio',
|
||||
],
|
||||
'qb-streetraces' => [
|
||||
'name' => 'qb-streetraces',
|
||||
'title' => 'Street Races',
|
||||
'category' => 'Entertainment & Activities',
|
||||
'description' => 'Street racing event system with records',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-streetraces',
|
||||
],
|
||||
|
||||
// Utilities & Miscellaneous
|
||||
'qb-doorlock' => [
|
||||
'name' => 'qb-doorlock',
|
||||
'title' => 'Door Lock',
|
||||
'category' => 'Utilities & Miscellaneous',
|
||||
'description' => 'Door locking system with access control',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-doorlock',
|
||||
],
|
||||
'qb-scrapyard' => [
|
||||
'name' => 'qb-scrapyard',
|
||||
'title' => 'Scrap Yard',
|
||||
'category' => 'Utilities & Miscellaneous',
|
||||
'description' => 'Vehicle scrapping system for parts and money',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-scrapyard',
|
||||
],
|
||||
'qb-smallresources' => [
|
||||
'name' => 'qb-smallresources',
|
||||
'title' => 'Small Resources',
|
||||
'category' => 'Utilities & Miscellaneous',
|
||||
'description' => 'Bundle of small utility resources for various features',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-smallresources',
|
||||
],
|
||||
'qb-weapons' => [
|
||||
'name' => 'qb-weapons',
|
||||
'title' => 'Weapons',
|
||||
'category' => 'Utilities & Miscellaneous',
|
||||
'description' => 'Weapon shop and ammo purchasing system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-weapons',
|
||||
],
|
||||
'qb-weathersync' => [
|
||||
'name' => 'qb-weathersync',
|
||||
'title' => 'Weather Sync',
|
||||
'category' => 'Utilities & Miscellaneous',
|
||||
'description' => 'Server-wide weather synchronization system',
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-weathersync',
|
||||
],
|
||||
];
|
||||
|
||||
if ($category) {
|
||||
return array_filter($allResources, fn ($r) => strtolower($r['category']) === strtolower($category));
|
||||
}
|
||||
|
||||
return $allResources;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the resource list.
|
||||
*/
|
||||
protected function formatResourceList(array $resources): string
|
||||
{
|
||||
return view('mcp.qbcore.qbcore-resource-list', [
|
||||
'resources' => $resources,
|
||||
])->render();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tool's input schema.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\JsonSchema\JsonSchema>
|
||||
*/
|
||||
public function schema(JsonSchema $schema): array
|
||||
{
|
||||
return [
|
||||
'category' => $schema
|
||||
->string()
|
||||
->description('Optional: Filter resources by category (Admin & Management, Jobs, Crime & Robberies, Housing & Interiors, Vehicles & Transportation, Commerce & Markets, Player Systems, UI & Interface, Entertainment & Activities, Utilities & Miscellaneous)')
|
||||
->enum([
|
||||
'Admin & Management',
|
||||
'Jobs',
|
||||
'Crime & Robberies',
|
||||
'Housing & Interiors',
|
||||
'Vehicles & Transportation',
|
||||
'Commerce & Markets',
|
||||
'Player Systems',
|
||||
'UI & Interface',
|
||||
'Entertainment & Activities',
|
||||
'Utilities & Miscellaneous',
|
||||
]),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,325 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mcp\Tools\QBCore;
|
||||
|
||||
use Illuminate\Contracts\JsonSchema\JsonSchema;
|
||||
use Laravel\Mcp\Request;
|
||||
use Laravel\Mcp\Response;
|
||||
use Laravel\Mcp\Server\Attributes\Description;
|
||||
use Laravel\Mcp\Server\Tool;
|
||||
|
||||
#[Description('Get detailed documentation for a specific QBCore resource. Returns information about configuration, commands, events, callbacks, and usage examples.')]
|
||||
class GetQBCoreResourceReference extends Tool
|
||||
{
|
||||
/**
|
||||
* Handle the tool request.
|
||||
*/
|
||||
public function handle(Request $request): Response
|
||||
{
|
||||
$resourceName = $request->get('resource_name');
|
||||
|
||||
$resource = $this->findResource($resourceName);
|
||||
|
||||
if (! $resource) {
|
||||
return Response::text(sprintf("QBCore resource '%s' not found. Use GetQBCoreResourceList to see all available resources.", $resourceName));
|
||||
}
|
||||
|
||||
return Response::text($this->formatResourceReference($resource));
|
||||
}
|
||||
|
||||
/**
|
||||
* Find a QBCore resource by name.
|
||||
*/
|
||||
protected function findResource(string $name): ?array
|
||||
{
|
||||
$resources = [
|
||||
'qb-adminmenu' => [
|
||||
'name' => 'qb-adminmenu',
|
||||
'title' => 'Admin Menu',
|
||||
'category' => 'Admin & Management',
|
||||
'description' => 'Admin panel for server management and player moderation.',
|
||||
'features' => ['Player Management', 'Moderation', 'Coordinate Tools', 'Announcements', 'Reports', 'Warnings'],
|
||||
'commands' => [
|
||||
'/admin' => 'Opens the admin menu',
|
||||
'/blips' => 'Toggles player blips',
|
||||
'/names' => 'Toggles player names display',
|
||||
'/coords' => 'Shows your current coordinates',
|
||||
'/maxmods' => 'Sets vehicle to max mods',
|
||||
'/noclip' => 'Toggles noclip mode',
|
||||
'/admincar' => 'Adds current vehicle to garage',
|
||||
'/announce [message]' => 'Creates an announcement',
|
||||
'/report [message]' => 'Create a report to staff',
|
||||
'/reportr [message]' => 'Replies to a user report',
|
||||
'/reporttoggle' => 'Opt in/out of receiving player reports',
|
||||
'/staffchat [message]' => 'Sends a staff-only message',
|
||||
'/warn [id] [reason]' => 'Warn a player',
|
||||
'/checkwarns [id] [opt: number]' => 'View warnings for a player',
|
||||
'/delwarn [id] [number]' => 'Delete a warning from a player',
|
||||
'/givenuifocus [id] [hasFocus] [hasCursor]' => 'Sets nuifocus state for player',
|
||||
'/setmodel [model] [id]' => 'Changes the players ped model',
|
||||
'/setspeed [opt: speed]' => 'Sets players foot speed',
|
||||
'/kickall' => 'Kick all players from server',
|
||||
'/setammo [amount] [opt: weapon]' => 'Set weapon ammo',
|
||||
'/vector2' => 'Copies vector2 to clipboard',
|
||||
'/vector3' => 'Copies vector3 to clipboard',
|
||||
'/vector4' => 'Copies vector4 to clipboard',
|
||||
'/heading' => 'Copies heading to clipboard',
|
||||
],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-adminmenu',
|
||||
],
|
||||
|
||||
'qb-ambulancejob' => [
|
||||
'name' => 'qb-ambulancejob',
|
||||
'title' => 'Ambulance Job',
|
||||
'category' => 'Jobs',
|
||||
'description' => 'Medical job with hospital check-in system, damage/bleeding mechanics, and patient revival.',
|
||||
'features' => ['Hospital Check-in System', 'Damage Tracking', 'Bleeding System', 'Patient Revival', 'Job Shop', 'Vehicle Spawner'],
|
||||
'commands' => [
|
||||
'/911e [message]' => 'Sends a message to EMS',
|
||||
'/status' => 'Check the status of the nearest player',
|
||||
'/heal' => 'Heals the nearest player',
|
||||
'/revivep' => 'Revives the nearest player',
|
||||
'/revive' => 'Revive yourself',
|
||||
'/setpain [opt: id]' => 'Sets the pain level',
|
||||
'/kill [opt: id]' => 'Kills the player',
|
||||
'/aheal [opt: id]' => 'Heals a player',
|
||||
],
|
||||
'items' => [
|
||||
'ifaks' => 'Relieves player stress and heals them by +10',
|
||||
'bandage' => 'Heals player by +10 and has 50% chance of removing 1 level of bleeding',
|
||||
'firstaid' => 'Completely heals closest player as long as they are in last-stand',
|
||||
'painkillers' => 'Stops bleeding temporarily but wears off over time',
|
||||
],
|
||||
'events' => [
|
||||
'hospital:server:SetDeathStatus' => 'Modify the players isdead metadata',
|
||||
'hospital:server:SetLaststandStatus' => 'Modify the players inlaststand metadata',
|
||||
'hospital:server:ambulanceAlert' => 'Send a notification to all EMTs',
|
||||
'hospital:server:RevivePlayer' => 'Revive a player for free or a fee',
|
||||
],
|
||||
'callbacks' => [
|
||||
'hospital:GetDoctors' => 'Returns the number of players online with the ambulance job',
|
||||
],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-ambulancejob',
|
||||
],
|
||||
|
||||
'qb-banking' => [
|
||||
'name' => 'qb-banking',
|
||||
'title' => 'Banking',
|
||||
'category' => 'Commerce & Markets',
|
||||
'description' => 'Bank account system with deposits, withdrawals, and transfers between players.',
|
||||
'features' => ['Account Management', 'Money Transfer', 'Transaction History', 'ATM Withdrawals'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-banking',
|
||||
],
|
||||
|
||||
'qb-inventory' => [
|
||||
'name' => 'qb-inventory',
|
||||
'title' => 'Inventory',
|
||||
'category' => 'Player Systems',
|
||||
'description' => 'Player item inventory management system with weight-based limits.',
|
||||
'features' => ['Item Management', 'Weight Limits', 'Inventory UI', 'Drop Items', 'Trade Items'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-inventory',
|
||||
],
|
||||
|
||||
'qb-phone' => [
|
||||
'name' => 'qb-phone',
|
||||
'title' => 'Phone',
|
||||
'category' => 'Player Systems',
|
||||
'description' => 'In-game phone system with apps, messages, calls, and notifications.',
|
||||
'features' => ['Messaging', 'Phone Calls', 'Apps System', 'Contacts', 'Photos', 'Radio'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-phone',
|
||||
],
|
||||
|
||||
'qb-policejob' => [
|
||||
'name' => 'qb-policejob',
|
||||
'title' => 'Police Job',
|
||||
'category' => 'Jobs',
|
||||
'description' => 'Law enforcement job with dispatch, arrest, jailing, and evidence system.',
|
||||
'features' => ['Dispatch System', 'Arrests', 'Jail Management', 'Evidence Collection', 'Vehicle Impound'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-policejob',
|
||||
],
|
||||
|
||||
'qb-garages' => [
|
||||
'name' => 'qb-garages',
|
||||
'title' => 'Garages',
|
||||
'category' => 'Vehicles & Transportation',
|
||||
'description' => 'Vehicle parking and retrieval system with multiple garage locations.',
|
||||
'features' => ['Multiple Garages', 'Vehicle Storage', 'Quick Parking', 'Vehicle Retrieval'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-garages',
|
||||
],
|
||||
|
||||
'qb-shops' => [
|
||||
'name' => 'qb-shops',
|
||||
'title' => 'Shops',
|
||||
'category' => 'Commerce & Markets',
|
||||
'description' => 'General-purpose shop system for creating generic stores.',
|
||||
'features' => ['Shop Creation', 'Item Pricing', 'Purchase System', 'Multiple Locations'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-shops',
|
||||
],
|
||||
|
||||
'qb-target' => [
|
||||
'name' => 'qb-target',
|
||||
'title' => 'Target System',
|
||||
'category' => 'UI & Interface',
|
||||
'description' => 'NPC and object targeting system for player interactions.',
|
||||
'features' => ['Click Targeting', 'NPC Interaction', 'Object Targeting', 'Distance Based'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-target',
|
||||
],
|
||||
|
||||
'qb-hud' => [
|
||||
'name' => 'qb-hud',
|
||||
'title' => 'HUD',
|
||||
'category' => 'UI & Interface',
|
||||
'description' => 'Main heads-up display showing player information and status.',
|
||||
'features' => ['Health Display', 'Armor Display', 'Hunger/Thirst', 'Stress Level', 'Mini Map'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-hud',
|
||||
],
|
||||
|
||||
'qb-doorlock' => [
|
||||
'name' => 'qb-doorlock',
|
||||
'title' => 'Door Lock',
|
||||
'category' => 'Utilities & Miscellaneous',
|
||||
'description' => 'Door locking system with access control and permissions.',
|
||||
'features' => ['Door Locking', 'Access Control', 'Job Locks', 'Gang Locks'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-doorlock',
|
||||
],
|
||||
|
||||
'qb-mechanicjob' => [
|
||||
'name' => 'qb-mechanicjob',
|
||||
'title' => 'Mechanic Job',
|
||||
'category' => 'Jobs',
|
||||
'description' => 'Vehicle repair and customization job with parts system.',
|
||||
'features' => ['Vehicle Repair', 'Vehicle Customization', 'Parts Management', 'Customer Jobs'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-mechanicjob',
|
||||
],
|
||||
|
||||
'qb-housing' => [
|
||||
'name' => 'qb-houses',
|
||||
'title' => 'Houses',
|
||||
'category' => 'Housing & Interiors',
|
||||
'description' => 'Player house ownership with storage and customization.',
|
||||
'features' => ['House Purchase', 'House Storage', 'Furniture Customization', 'Multi-Garage'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-houses',
|
||||
],
|
||||
|
||||
'qb-prison' => [
|
||||
'name' => 'qb-prison',
|
||||
'title' => 'Prison',
|
||||
'category' => 'Player Systems',
|
||||
'description' => 'Prison system for jailed players with tasks and release.',
|
||||
'features' => ['Jailing System', 'Prison Jobs', 'Release System', 'Time Tracking'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-prison',
|
||||
],
|
||||
|
||||
'qb-bankrobbery' => [
|
||||
'name' => 'qb-bankrobbery',
|
||||
'title' => 'Bank Robbery',
|
||||
'category' => 'Crime & Robberies',
|
||||
'description' => 'Heist job with thermal drill, hacking, and loot system.',
|
||||
'features' => ['Thermal Drill', 'Hacking Minigame', 'Loot System', 'Police Alerts'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-bankrobbery',
|
||||
],
|
||||
|
||||
'qb-drugs' => [
|
||||
'name' => 'qb-drugs',
|
||||
'title' => 'Drug Dealing',
|
||||
'category' => 'Crime & Robberies',
|
||||
'description' => 'Drug production and dealing system with supply and demand.',
|
||||
'features' => ['Drug Production', 'Dealing Mechanics', 'Supply/Demand', 'Dealer Routes'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-drugs',
|
||||
],
|
||||
|
||||
'qb-fuel' => [
|
||||
'name' => 'qb-fuel',
|
||||
'title' => 'Fuel System',
|
||||
'category' => 'Vehicles & Transportation',
|
||||
'description' => 'Vehicle fueling system with gas stations.',
|
||||
'features' => ['Gas Stations', 'Fuel Usage', 'Cost Calculation', 'Player Jobs'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-fuel',
|
||||
],
|
||||
|
||||
'qb-multicharacter' => [
|
||||
'name' => 'qb-multicharacter',
|
||||
'title' => 'Multi-Character',
|
||||
'category' => 'Player Systems',
|
||||
'description' => 'Multiple character selection and management on login.',
|
||||
'features' => ['Character Creation', 'Character Selection', 'Character Deletion'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-multicharacter',
|
||||
],
|
||||
|
||||
'qb-clothing' => [
|
||||
'name' => 'qb-clothing',
|
||||
'title' => 'Clothing Shop',
|
||||
'category' => 'Commerce & Markets',
|
||||
'description' => 'Clothing store system for outfit customization.',
|
||||
'features' => ['Outfit Customization', 'Clothing Purchase', 'Clothing Categories'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-clothing',
|
||||
],
|
||||
|
||||
'qb-vehicleshop' => [
|
||||
'name' => 'qb-vehicleshop',
|
||||
'title' => 'Vehicle Shop',
|
||||
'category' => 'Vehicles & Transportation',
|
||||
'description' => 'Show room for purchasing new vehicles.',
|
||||
'features' => ['Vehicle Showcase', 'Vehicle Purchase', 'Test Drive'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-vehicleshop',
|
||||
],
|
||||
|
||||
'qb-input' => [
|
||||
'name' => 'qb-input',
|
||||
'title' => 'Input',
|
||||
'category' => 'UI & Interface',
|
||||
'description' => 'Generic input dialog system for NUI popups.',
|
||||
'features' => ['Text Input', 'Number Input', 'Validation', 'Custom Styling'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-input',
|
||||
],
|
||||
|
||||
'qb-manage' => [
|
||||
'name' => 'qb-management',
|
||||
'title' => 'Management',
|
||||
'category' => 'Player Systems',
|
||||
'description' => 'Org/faction/job management for player hierarchies.',
|
||||
'features' => ['Rank Management', 'Member Management', 'Permission Control'],
|
||||
'url' => 'https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-management',
|
||||
],
|
||||
];
|
||||
|
||||
// Normalize the resource name for matching
|
||||
$normalized = strtolower(str_replace(['_', ' '], '-', $name));
|
||||
// Remove any prefix variations and ensure qb- prefix
|
||||
$normalized = preg_replace('/^(qbcore[-_]?)?/i', '', $normalized);
|
||||
$normalized = 'qb-'.ltrim($normalized, 'qb-');
|
||||
|
||||
foreach ($resources as $resource) {
|
||||
if (strtolower($resource['name']) === $normalized) {
|
||||
return $resource;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Format the resource reference.
|
||||
*/
|
||||
protected function formatResourceReference(array $resource): string
|
||||
{
|
||||
return view('mcp.qbcore.qbcore-resource-reference', [
|
||||
'resource' => $resource,
|
||||
])->render();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tool's input schema.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\JsonSchema\JsonSchema>
|
||||
*/
|
||||
public function schema(JsonSchema $schema): array
|
||||
{
|
||||
return [
|
||||
'resource_name' => $schema
|
||||
->string()
|
||||
->description('The name of the QBCore resource to look up (e.g., qb-ambulancejob, qb-adminmenu, qb-inventory)')
|
||||
->required(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
## QBCore Resources Directory
|
||||
|
||||
Complete list of all {{ count($resources) }} official QBCore resources. Use `GetQBCoreResourceReference` to get detailed information about specific resources.
|
||||
|
||||
@php
|
||||
$grouped = collect($resources)->groupBy('category');
|
||||
@endphp
|
||||
|
||||
@foreach($grouped as $category => $categoryResources)
|
||||
### {{ $category }}
|
||||
|
||||
| Resource | Description | Documentation |
|
||||
|----------|-------------|-----------------|
|
||||
@foreach($categoryResources as $resource)
|
||||
| **{{ $resource['title'] }}** (`{{ $resource['name'] }}`) | {{ $resource['description'] }} | [View Docs]({{ $resource['url'] }}) |
|
||||
@endforeach
|
||||
|
||||
@endforeach
|
||||
|
||||
### Quick Links
|
||||
- [QBCore Framework GitHub](https://github.com/qbcore-framework)
|
||||
- [QBCore Documentation](https://docs.qbcore.org)
|
||||
- [QBCore Discord Community](https://discord.gg/qbcore)
|
||||
|
||||
**Total Resources:** {{ count($resources) }}
|
||||
@@ -0,0 +1,64 @@
|
||||
## {{ $resource['title'] }} (`{{ $resource['name'] }}`)
|
||||
|
||||
**Category:** {!! $resource['category'] !!}
|
||||
|
||||
{{ $resource['description'] }}
|
||||
|
||||
### Overview
|
||||
|
||||
{{ $resource['description'] }}
|
||||
|
||||
@if(isset($resource['features']) && !empty($resource['features']))
|
||||
#### Key Features
|
||||
@foreach($resource['features'] as $feature)
|
||||
- {{ $feature }}
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@if(isset($resource['commands']) && !empty($resource['commands']))
|
||||
### Commands
|
||||
|
||||
@foreach($resource['commands'] as $command => $description)
|
||||
#### `{{ $command }}`
|
||||
{{ $description }}
|
||||
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@if(isset($resource['events']) && !empty($resource['events']))
|
||||
### Events
|
||||
|
||||
@foreach($resource['events'] as $event => $description)
|
||||
#### `{{ $event }}`
|
||||
{{ $description }}
|
||||
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@if(isset($resource['callbacks']) && !empty($resource['callbacks']))
|
||||
### Callbacks
|
||||
|
||||
@foreach($resource['callbacks'] as $callback => $description)
|
||||
#### `{{ $callback }}`
|
||||
{{ $description }}
|
||||
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
@if(isset($resource['items']) && !empty($resource['items']))
|
||||
### Items
|
||||
|
||||
| Item | Description |
|
||||
|------|-------------|
|
||||
@foreach($resource['items'] as $item => $description)
|
||||
| `{{ $item }}` | {{ $description }} |
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
### Documentation
|
||||
- [Resource Documentation]({{ $resource['url'] }})
|
||||
- [QBCore Framework](https://docs.qbcore.org)
|
||||
- [GitHub Repository](https://github.com/qbcore-framework)
|
||||
|
||||
**Learn More:**
|
||||
To get detailed configuration options and advanced usage, visit the [full documentation]({{ $resource['url'] }}) for this resource.
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,132 @@
|
||||
<?php
|
||||
|
||||
use App\Mcp\Tools\QBCore\GetQBCoreResourceList;
|
||||
use Laravel\Mcp\Request;
|
||||
|
||||
test('GetQBCoreResourceList returns all resources', function () {
|
||||
$tool = new GetQBCoreResourceList;
|
||||
$request = new Request([]);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('QBCore Resources Directory');
|
||||
expect($content)->toContain('qb-ambulancejob');
|
||||
expect($content)->toContain('qb-adminmenu');
|
||||
expect($content)->toContain('qb-policejob');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceList contains all 58 resources', function () {
|
||||
$tool = new GetQBCoreResourceList;
|
||||
$request = new Request([]);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
// Count resource names in the response
|
||||
$resources = [
|
||||
'qb-adminmenu', 'qb-ambulancejob', 'qb-apartments', 'qb-banking', 'qb-bankrobbery',
|
||||
'qb-busjob', 'qb-cityhall', 'qb-clothing', 'qb-crypto', 'qb-diving',
|
||||
'qb-doorlock', 'qb-drugs', 'qb-fitbit', 'qb-fuel', 'qb-garages',
|
||||
'qb-garbagejob', 'qb-hotdogjob', 'qb-houserobbery', 'qb-houses', 'qb-hud',
|
||||
'qb-input', 'qb-interior', 'qb-inventory', 'qb-jewelry', 'qb-lapraces',
|
||||
'qb-loading', 'qb-management', 'qb-mechanicjob', 'qb-menu', 'qb-minigames',
|
||||
'qb-multicharacter', 'qb-newsjob', 'qb-pawnshop', 'qb-phone', 'qb-policejob',
|
||||
'qb-prison', 'qb-radialmenu', 'qb-radio', 'qb-recyclejob', 'qb-scoreboard',
|
||||
'qb-scrapyard', 'qb-shops', 'qb-smallresources', 'qb-spawn', 'qb-storerobbery',
|
||||
'qb-streetraces', 'qb-taxijob', 'qb-towjob', 'qb-target', 'qb-truckerjob',
|
||||
'qb-truckrobbery', 'qb-vehiclekeys', 'qb-vehiclesales', 'qb-vehicleshop', 'qb-vineyard',
|
||||
'qb-weapons', 'qb-weathersync', 'qb-weed',
|
||||
];
|
||||
|
||||
foreach ($resources as $resource) {
|
||||
expect($content)->toContain($resource);
|
||||
}
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceList filters by category - Jobs', function () {
|
||||
$tool = new GetQBCoreResourceList;
|
||||
$request = new Request(['category' => 'Jobs']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
// Should contain job resources
|
||||
expect($content)->toContain('qb-ambulancejob');
|
||||
expect($content)->toContain('qb-policejob');
|
||||
expect($content)->toContain('qb-mechanicjob');
|
||||
|
||||
// Should not contain non-job resources
|
||||
expect($content)->not->toContain('## Admin & Management');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceList filters by category - Crime & Robberies', function () {
|
||||
$tool = new GetQBCoreResourceList;
|
||||
$request = new Request(['category' => 'Crime & Robberies']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('qb-bankrobbery');
|
||||
expect($content)->toContain('qb-drugs');
|
||||
expect($content)->toContain('qb-weed');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceList filters by category - Admin & Management', function () {
|
||||
$tool = new GetQBCoreResourceList;
|
||||
$request = new Request(['category' => 'Admin & Management']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('qb-adminmenu');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceList filters by category - UI & Interface', function () {
|
||||
$tool = new GetQBCoreResourceList;
|
||||
$request = new Request(['category' => 'UI & Interface']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('qb-hud');
|
||||
expect($content)->toContain('qb-menu');
|
||||
expect($content)->toContain('qb-target');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceList filters by category - Housing & Interiors', function () {
|
||||
$tool = new GetQBCoreResourceList;
|
||||
$request = new Request(['category' => 'Housing & Interiors']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('qb-apartments');
|
||||
expect($content)->toContain('qb-houses');
|
||||
expect($content)->toContain('qb-interior');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceList contains documentation links', function () {
|
||||
$tool = new GetQBCoreResourceList;
|
||||
$request = new Request([]);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('https://docs.qbcore.org/qbcore-documentation/qbcore-resources/');
|
||||
expect($content)->toContain('View Docs');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceList has grouped categories', function () {
|
||||
$tool = new GetQBCoreResourceList;
|
||||
$request = new Request([]);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('### Admin');
|
||||
expect($content)->toContain('### Jobs');
|
||||
expect($content)->toContain('### Crime');
|
||||
expect($content)->toContain('### Housing');
|
||||
expect($content)->toContain('### Vehicles');
|
||||
});
|
||||
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
|
||||
use App\Mcp\Tools\QBCore\GetQBCoreResourceReference;
|
||||
use Laravel\Mcp\Request;
|
||||
|
||||
test('GetQBCoreResourceReference returns ambulance job details', function () {
|
||||
$tool = new GetQBCoreResourceReference;
|
||||
$request = new Request(['resource_name' => 'qb-ambulancejob']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('Ambulance Job');
|
||||
expect($content)->toContain('Hospital Check-in System');
|
||||
expect($content)->toContain('/heal');
|
||||
expect($content)->toContain('ifaks');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceReference returns admin menu details', function () {
|
||||
$tool = new GetQBCoreResourceReference;
|
||||
$request = new Request(['resource_name' => 'qb-adminmenu']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('Admin Menu');
|
||||
expect($content)->toContain('/admin');
|
||||
expect($content)->toContain('/blips');
|
||||
expect($content)->toContain('Player Management');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceReference returns hud details', function () {
|
||||
$tool = new GetQBCoreResourceReference;
|
||||
$request = new Request(['resource_name' => 'qb-hud']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('HUD');
|
||||
expect($content)->toContain('Health Display');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceReference returns inventory details', function () {
|
||||
$tool = new GetQBCoreResourceReference;
|
||||
$request = new Request(['resource_name' => 'qb-inventory']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('Inventory');
|
||||
expect($content)->toContain('Player Systems');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceReference returns phone details', function () {
|
||||
$tool = new GetQBCoreResourceReference;
|
||||
$request = new Request(['resource_name' => 'qb-phone']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('Phone');
|
||||
expect($content)->toContain('Messaging');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceReference returns police job details', function () {
|
||||
$tool = new GetQBCoreResourceReference;
|
||||
$request = new Request(['resource_name' => 'qb-policejob']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('Police Job');
|
||||
expect($content)->toContain('Dispatch System');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceReference includes documentation URL', function () {
|
||||
$tool = new GetQBCoreResourceReference;
|
||||
$request = new Request(['resource_name' => 'qb-adminmenu']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('https://docs.qbcore.org/qbcore-documentation/qbcore-resources/qb-adminmenu');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceReference not found returns helpful message', function () {
|
||||
$tool = new GetQBCoreResourceReference;
|
||||
$request = new Request(['resource_name' => 'qb-nonexistent']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('not found');
|
||||
expect($content)->toContain('GetQBCoreResourceList');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceReference handles case variations', function () {
|
||||
$tool = new GetQBCoreResourceReference;
|
||||
$request = new Request(['resource_name' => 'QBCore-Ambulancejob']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('Ambulance Job');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceReference returns garages details', function () {
|
||||
$tool = new GetQBCoreResourceReference;
|
||||
$request = new Request(['resource_name' => 'qb-garages']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('Garages');
|
||||
expect($content)->toContain('Transportation');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceReference returns shops details', function () {
|
||||
$tool = new GetQBCoreResourceReference;
|
||||
$request = new Request(['resource_name' => 'qb-shops']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('Shops');
|
||||
expect($content)->toContain('Commerce');
|
||||
});
|
||||
|
||||
test('GetQBCoreResourceReference includes categories', function () {
|
||||
$tool = new GetQBCoreResourceReference;
|
||||
$request = new Request(['resource_name' => 'qb-target']);
|
||||
|
||||
$response = $tool->handle($request);
|
||||
$content = (string) $response->content();
|
||||
|
||||
expect($content)->toContain('UI & Interface');
|
||||
expect($content)->toContain('Target System');
|
||||
});
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user