import { PackageManifest } from './manifest-utils.js'; /** * Info about a single API route (one SmrtObject with api.include) */ export interface AgentAPIRouteInfo { /** SmrtObject class name (e.g., 'Performer') */ className: string; /** Allowed CRUD actions (e.g., ['list', 'get', 'create', 'update', 'delete']) */ allowedActions: string[]; /** Package that owns this resource */ packageName?: string; } /** * Result of resolving a URL path against the route map */ export interface ResolvedAPIRoute { /** The matched route info */ route: AgentAPIRouteInfo; /** Resource ID if path includes one (e.g., 'performers/abc-123') */ id?: string; /** Custom action name if path includes one (e.g., 'performers/abc-123/generate-image') */ action?: string; } /** * Build a route map from loaded package manifests. * * Iterates all objects in each manifest, and for any object with a * `decoratorConfig.api.include` array, registers a route. The route * path is derived from `decoratorConfig.api.path` if set, otherwise * from the table name with underscores converted to hyphens. * * @param manifests - Array of parsed package manifest JSON objects * @returns Map of resource path -> route info * * @example * ```typescript * const manifests = [histrioManifest, praecoManifest]; * const routes = buildRouteMap(manifests); * // routes.get('performers') => { className: 'Performer', allowedActions: ['list', 'get', 'create', 'update', 'delete'] } * // routes.get('video-contents') => { className: 'VideoShot', allowedActions: ['list', 'get', 'create', 'update'] } * ``` */ export declare function buildRouteMap(manifests: PackageManifest[]): Map; /** * Resolve a URL resource path against a route map. * * Handles three URL patterns: * - `performers` → list/create (no id) * - `performers/abc-123` → get/update/delete (with id) * - `performers/abc-123/generate-image` → custom action * * @param urlPath - The resource portion of the URL (after `/api/agents/{agentId}/`) * @param routes - Route map from {@link buildRouteMap} * @returns Resolved route with optional id/action, or null if no match */ export declare function resolveAPIRoute(urlPath: string, routes: Map): ResolvedAPIRoute | null; //# sourceMappingURL=api-routes.d.ts.map