Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | // src/types.ts — Central type definitions for Laravel Maestro
// ─── Route Intelligence ────────────────────────────────────────────────────
export interface RouteDefinition {
name: string;
uri: string;
methods: string[];
action: string;
controllerClass?: string;
controllerMethod?: string;
middleware: string[];
parameters: RouteParameter[];
filePath?: string;
lineNumber?: number;
}
export interface RouteParameter { name: string; required: boolean; pattern?: string; }
// ─── Eloquent / Database ──────────────────────────────────────────────────
export interface ModelDefinition {
className: string; namespace: string; filePath: string; tableName: string;
fillable: string[]; guarded: string[]; hidden: string[]; casts: Record<string,string>;
relationships: RelationshipDefinition[]; scopes: ScopeDefinition[];
columns: ColumnDefinition[]; accessors: AccessorDefinition[];
primaryKey: string; timestamps: boolean; softDeletes: boolean;
policyClass?: string; factoryClass?: string; observerClass?: string;
}
export type RelationType = 'hasOne'|'hasMany'|'belongsTo'|'belongsToMany'|'hasManyThrough'|'hasOneThrough'|'morphTo'|'morphMany'|'morphOne'|'morphToMany';
export interface RelationshipDefinition { name: string; type: RelationType; relatedModel: string; foreignKey?: string; localKey?: string; }
export interface ScopeDefinition { name: string; parameters: string[]; }
export interface AccessorDefinition { name: string; returnType?: string; }
export interface ColumnDefinition { name: string; type: string; nullable: boolean; default?: string; length?: number; unsigned?: boolean; }
// ─── Symbol Table ─────────────────────────────────────────────────────────
export interface PhpClass {
name: string; namespace: string; fullyQualifiedName: string;
filePath: string; lineNumber: number; extends?: string;
implements: string[]; methods: PhpMethod[]; properties: PhpProperty[];
constants: PhpConstant[]; docComment?: string; isAbstract: boolean;
isFinal: boolean; traits: string[]; attributes: PhpAttribute[];
}
export interface PhpMethod {
name: string; visibility: 'public'|'protected'|'private'; isStatic: boolean;
returnType?: string; parameters: PhpParameter[]; lineNumber: number;
docComment?: string; isAbstract: boolean; attributes: PhpAttribute[];
relation?: RelationshipDefinition;
}
export interface PhpParameter { name: string; type?: string; defaultValue?: string; isVariadic: boolean; isNullable: boolean; }
export interface PhpProperty { name: string; visibility: 'public'|'protected'|'private'; isStatic: boolean; type?: string; defaultValue?: string; lineNumber: number; docComment?: string; }
export interface PhpConstant { name: string; value?: string; visibility: 'public'|'protected'|'private'; lineNumber: number; }
export interface PhpAttribute { name: string; arguments: string[]; }
// ─── Blade Templates ──────────────────────────────────────────────────────
export interface BladeComponent { name: string; tag: string; className?: string; namespace?: string; filePath: string; viewPath?: string; props: BladeComponentProp[]; slots: string[]; isAnonymous: boolean; }
export interface BladeComponentProp { name: string; type?: string; required: boolean; default?: string; }
export interface BladeDirective { name: string; hasArguments: boolean; documentation?: string; }
// ─── Validation ───────────────────────────────────────────────────────────
export interface FormRequestDefinition {
className: string; namespace: string; fullyQualifiedName: string;
filePath: string; lineNumber: number; fields: RequestFieldDefinition[];
}
export interface RequestFieldDefinition { name: string; rules: string[]; lineNumber: number; }
// ─── Livewire ─────────────────────────────────────────────────────────────
export interface LivewireComponent {
name: string; tag: string; className: string; namespace: string;
fullyQualifiedName: string; filePath: string; viewPath?: string;
properties: LivewireProperty[]; methods: LivewireMethod[];
computedProperties: string[]; isVolt: boolean;
}
export interface LivewireProperty { name: string; type?: string; isPublic: boolean; hasWire: boolean; }
export interface LivewireMethod { name: string; parameters: string[]; isAction: boolean; isLifecycle: boolean; lineNumber?: number; }
// ─── Inertia ──────────────────────────────────────────────────────────────
export interface InertiaPage { name: string; filePath: string; props: string[]; componentFramework: 'vue'|'react'|'svelte'|'unknown'; }
// ─── Filament ─────────────────────────────────────────────────────────────
export interface FilamentResource { name: string; className: string; namespace: string; filePath: string; modelClass?: string; hasTable: boolean; hasForm: boolean; pages: FilamentPage[]; }
export interface FilamentPage { type: 'list'|'create'|'edit'|'view'|'custom'; className: string; filePath: string; }
// ─── .env File ────────────────────────────────────────────────────────────
export interface EnvVariable { key: string; value: string; filePath: string; lineNumber: number; isSensitive: boolean; }
// ─── Artisan Commands ─────────────────────────────────────────────────────
export interface ArtisanCommand { name: string; description: string; options: ArtisanOption[]; arguments: ArtisanArgument[]; filePath?: string; isCustom: boolean; }
export interface ArtisanOption { name: string; shortcut?: string; description: string; acceptsValue: boolean; }
export interface ArtisanArgument { name: string; required: boolean; description: string; }
// ─── Observer ─────────────────────────────────────────────────────────────
export interface ObserverDefinition { className: string; namespace: string; filePath: string; modelClass?: string; methods: string[]; }
// ─── Configuration ────────────────────────────────────────────────────────
export interface ConfigValue { key: string; value: unknown; filePath?: string; }
// ─── Translation (i18n) ───────────────────────────────────────────────────
export interface TranslationKey { key: string; value: string; locale: string; filePath: string; lineNumber?: number; }
// ─── ide.json Extensibility ───────────────────────────────────────────────
export interface IdeJsonSchema { functions?: IdeJsonFunction[]; classes?: IdeJsonClass[]; }
export interface IdeJsonFunction { name: string; parameters_patterns: IdeJsonParameterPattern[]; }
export interface IdeJsonParameterPattern { parameter: number; type: IdeJsonParameterType; }
export type IdeJsonParameterType = 'route'|'view'|'config'|'translation'|'model'|'column'|'middleware'|'artisan'|'env';
export interface IdeJsonClass { name: string; inherits?: string; }
// ─── Workspace Index ──────────────────────────────────────────────────────
export interface WorkspaceIndex {
routes: Map<string, RouteDefinition>;
models: Map<string, ModelDefinition>;
classes: Map<string, PhpClass>;
bladeComponents: Map<string, BladeComponent>;
configs: Map<string, ConfigValue>;
translations: Map<string, TranslationKey>;
dbSchema: Map<string, ColumnDefinition[]>;
views: Map<string, string>;
formRequests: Map<string, FormRequestDefinition>;
livewireComponents: Map<string, LivewireComponent>;
inertiaPages: Map<string, InertiaPage>;
filamentResources: Map<string, FilamentResource>;
envVariables: Map<string, EnvVariable>;
nwidartModules: Set<string>;
pennantFeatures: PennantFeature[];
novaResources: Map<string, NovaResource>;
artisanCommands: Map<string, ArtisanCommand>;
enums: Map<string, import('./providers/LaravelEnumsProvider').EnumDefinition>;
observers: Map<string, ObserverDefinition>;
lastIndexed: Date;
}
// ─── Runtime Extraction Payload ───────────────────────────────────────────
export interface RuntimePayload {
routes: RuntimeRoute[]; config: Record<string,unknown>;
schema: Record<string,RuntimeColumn[]>; views: string[]; timestamp: number;
artisanCommands?: RuntimeArtisanCommand[];
}
export interface RuntimeRoute { name: string; uri: string; methods: string[]; action: string; middleware: string[]; }
export interface RuntimeColumn { name: string; type: string; nullable: boolean; default: string|null; length: number|null; }
export interface RuntimeArtisanCommand { name: string; description: string; definition: string; }
// ─── Nova / Dusk ──────────────────────────────────────────────────────────
export interface NovaResource {
className: string; filePath: string; modelClass: string;
}
export interface DuskPage {
className: string; filePath: string; url?: string;
}
// ─── Pennant Features ─────────────────────────────────────────────────────
export interface PennantFeature {
name: string; isClassBased: boolean;
className?: string; filePath?: string;
}
// ─── Accessor ─────────────────────────────────────────────────────────────
export interface AccessorDefinition {
name: string; // snake_case virtual property name
methodName: string; // actual PHP method name
returnType?: string;
}
// ─── Laravel 13 AI SDK ────────────────────────────────────────────────────
export interface AiModelConfig {
provider: string;
model: string;
temperature?: number;
maxTokens?: number;
}
export interface VectorColumn {
table: string;
column: string;
dimensions: number;
indexType: 'hnsw' | 'ivfflat';
}
// ─── JSON:API (Laravel 13) ────────────────────────────────────────────────
export interface JsonApiResourceDefinition {
className: string;
resourceType: string;
filePath: string;
attributes: string[];
relationships: string[];
}
// ─── Extension Settings ───────────────────────────────────────────────────
export interface ExtensionConfig {
phpExecutable: string; runtimeExtractionTimeout: number;
enableEloquentCompletion: boolean; enableRouteCompletion: boolean;
enableBladeCompletion: boolean; enableInlayHints: boolean;
enableCodeLens: boolean; excludePatterns: string[]; lruCacheSize: number;
}
|