/** * Context-Aware API Module * * Provides framework utilities that automatically use the current tenant context. * Tools and workflows can import and use these without passing any context parameters. * * @example * ```typescript * import { api } from "veryfront/workflow"; * * const myTool = { * id: "fetch-file", * execute: async (input) => { * // Just use api - it automatically knows the current project * const content = await api.files.read(input.path); * return content; * }, * }; * ``` */ import { VeryfrontApiClient } from "../platform/adapters/veryfront-api-client/client.js"; /** * Get the current tenant context from either workflow execution or request context. * @throws Error if no tenant context is available or if validation fails */ declare function getTenant(): import("./types.js").CapturedTenantContext; /** * Create a VeryfrontApiClient configured for the current tenant. * Each call creates a new client instance configured with the current tenant's credentials. */ declare function getClient(): VeryfrontApiClient; /** * Context-aware API that automatically uses the current tenant. * * All methods will throw an error if called outside of a request or workflow context. */ export declare const api: { /** * File operations for the current project */ files: { /** * Read file content by path * @param path - File path relative to project root (e.g., "/pages/index.tsx") */ read: (path: string) => Promise; /** * List files in the project * @param options - List options (cursor, limit, pattern) */ list: (options?: { cursor?: string; limit?: number; pattern?: string; }) => Promise; /** * List all files in the project (handles pagination automatically) */ listAll: (options?: { limit?: number; pattern?: string; }) => Promise; version_id: import("../internal-agents/schema.js").Schema; path: import("../internal-agents/schema.js").Schema; content: import("../internal-agents/schema.js").Schema; size: import("../internal-agents/schema.js").Schema; type: import("../internal-agents/schema.js").Schema<"function" | "file" | "page" | "component">; updated_at: import("../internal-agents/schema.js").Schema; }>[]>; /** * Get file details (content + metadata) * @param pathOrId - File path or ID */ get: (pathOrId: string) => Promise; /** * Search for files matching a pattern * @param pattern - Search pattern (glob-like) */ search: (pattern: string) => Promise<{ id?: string; path: string; }[]>; }; /** * Project operations */ project: { /** * Get current project details */ get: () => Promise; name: import("../internal-agents/schema.js").Schema; slug: import("../internal-agents/schema.js").Schema; description: import("../internal-agents/schema.js").Schema; created_at: import("../internal-agents/schema.js").Schema; updated_at: import("../internal-agents/schema.js").Schema; provider: import("../internal-agents/schema.js").Schema; provider_id: import("../internal-agents/schema.js").Schema; layout: import("../internal-agents/schema.js").Schema; layout_id: import("../internal-agents/schema.js").Schema; config: import("../internal-agents/schema.js").Schema | undefined>; }>>; /** * Get the current project slug */ slug: () => string; /** * Get the current project ID (if available) */ id: () => string | undefined; /** * Check if running in production mode */ isProduction: () => boolean; }; /** * Get the raw tenant context (for advanced use cases) * @internal */ _getTenant: typeof getTenant; /** * Get a configured API client (for advanced use cases) * @internal */ _getClient: typeof getClient; }; export {}; //# sourceMappingURL=api.d.ts.map