# Complete API Index

Quick reference for all lua-cli APIs and exports.

## Core Classes

| Class | Purpose | Import |
|-------|---------|--------|
| [LuaAgent](./api/LuaAgent.md) | Unified agent configuration | `import { LuaAgent } from 'lua-cli'` |
| [LuaSkill](./api/LuaSkill.md) | Tool collection | `import { LuaSkill } from 'lua-cli'` |
| [LuaTool](./api/LuaTool.md) | Individual tool interface | `import { LuaTool } from 'lua-cli/skill'` |
| [LuaWebhook](./api/LuaWebhook.md) | HTTP webhook handler | `import { LuaWebhook } from 'lua-cli'` |
| [LuaJob](./api/LuaJob.md) | Scheduled task | `import { LuaJob } from 'lua-cli'` |
| [PreProcessor](./api/PreProcessor.md) | Message preprocessor | `import { PreProcessor } from 'lua-cli'` |
| [PostProcessor](./api/PostProcessor.md) | Response postprocessor | `import { PostProcessor } from 'lua-cli'` |
| LuaMCPServer | MCP server integration | `import { LuaMCPServer } from 'lua-cli'` |

## Runtime APIs

| API | Purpose | Methods |
|-----|---------|---------|
| [AI](./api/AI.md) | AI text generation | `generate()` |
| [User](./api/User.md) | User data management | `get()`, `getChatHistory()` |
| [Products](./api/Products.md) | Product catalog | `get()`, `search()`, `getById()`, `create()`, `update()`, `delete()` |
| [Baskets](./api/Baskets.md) | Shopping carts | `get()`, `create()`, `getById()`, `addItem()`, `clear()`, `placeOrder()` |
| [Orders](./api/Orders.md) | Order management | `get()`, `getById()`, `create()`, `updateStatus()`, `updateData()` |
| [Data](./api/Data.md) | Custom data storage | `get()`, `getEntry()`, `search()`, `create()`, `update()`, `delete()` |
| [Jobs](./api/Jobs.md) | Dynamic job creation | `create()`, `getJob()`, `getAll()` |
| [Templates](./api/Templates.md) | WhatsApp templates | `Templates.whatsapp.list()`, `.get()`, `.send()` |
| [CDN](./api/CDN.md) | File upload/download | `upload()`, `get()` |
| Lua | Runtime context | `Lua.request.channel`, `Lua.request.webhook` |

## Instance Classes

| Instance | Description | Key Methods |
|----------|-------------|-------------|
| UserDataInstance | User data with proxy access | `update()`, `send()`, `clear()`, `save()`, `getChatHistory()` |
| ProductInstance | Product with CRUD methods | `update()`, `delete()`, `save()` |
| BasketInstance | Shopping cart with operations | `addItem()`, `removeItem()`, `clear()`, `placeOrder()` |
| OrderInstance | Order with status management | `updateStatus()`, `updateData()`, `save()` |
| DataEntryInstance | Custom data entry | `update()`, `delete()`, `save()` |
| JobInstance | Job with metadata access | `user()`, `updateMetadata()`, `delete()` |

## Enums

| Enum | Values | Usage |
|------|--------|-------|
| BasketStatus | `ACTIVE`, `CHECKED_OUT`, `ABANDONED`, `EXPIRED` | Basket state management |
| OrderStatus | `PENDING`, `CONFIRMED`, `FULFILLED`, `CANCELLED` | Order state tracking |

## Utilities

| Function | Purpose | Example |
|----------|---------|---------|
| [env()](./api/env.md) | Access environment variables | `env('API_KEY')` |

## Type Definitions

| Type | Description | File |
|------|-------------|------|
| ChatMessage | Message format for user communication | See [User API](./api/User.md) |
| JobSchedule | Job scheduling configuration | See [Jobs API](./api/Jobs.md) |
| Product | Product data structure | See [Products API](./api/Products.md) |
| Basket | Basket data structure | See [Baskets API](./api/Baskets.md) |
| Order | Order data structure | See [Orders API](./api/Orders.md) |

## Quick Links by Use Case

### Building an Agent
1. [LuaAgent](./api/LuaAgent.md) - Configure your agent
2. [LuaSkill](./api/LuaSkill.md) - Organize tools
3. [LuaTool](./api/LuaTool.md) - Create tools

### E-commerce
1. [Products API](./api/Products.md) - Manage catalog
2. [Baskets API](./api/Baskets.md) - Shopping carts
3. [Orders API](./api/Orders.md) - Process orders
4. [CDN API](./api/CDN.md) - Product images/files

### Automation
1. [LuaJob](./api/LuaJob.md) - Scheduled tasks (cron, intervals)
2. [Jobs API](./api/Jobs.md) - Dynamic job creation from tools
3. [LuaWebhook](./api/LuaWebhook.md) - External HTTP triggers
4. [PreProcessor](./api/PreProcessor.md) - Filter incoming messages
5. [PostProcessor](./api/PostProcessor.md) - Format responses

### Data Management
1. [User API](./api/User.md) - User data
2. [Data API](./api/Data.md) - Custom collections
3. [CDN API](./api/CDN.md) - File storage
4. env() - Environment config

### Communication
1. [User API](./api/User.md) - Send messages to users
2. [Templates API](./api/Templates.md) - WhatsApp template messages
3. [AI API](./api/AI.md) - Generate AI responses

---

**See [README](./README.md) for complete documentation navigation**
