lua-cli 3.0.0-alpha.9 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +864 -0
- package/dist/api/chat.api.service.d.ts +8 -0
- package/dist/api/chat.api.service.js +55 -0
- package/dist/api/products.api.service.d.ts +2 -1
- package/dist/api/products.api.service.js +11 -10
- package/dist/api-exports.d.ts +1 -1
- package/dist/api-exports.js +6 -1
- package/dist/commands/chat.js +35 -32
- package/dist/commands/init.js +10 -2
- package/dist/index.js +2 -2
- package/dist/interfaces/message.d.ts +2 -2
- package/dist/utils/agent-management.d.ts +1 -1
- package/dist/utils/agent-management.js +5 -3
- package/dist/utils/init-helpers.d.ts +10 -1
- package/dist/utils/init-helpers.js +44 -1
- package/dist/utils/pre-bundle-jobs.js +9 -9
- package/dist/utils/sandbox.js +1 -2
- package/package.json +3 -3
- package/template/QUICKSTART.md +693 -191
- package/template/README.md +673 -802
- package/template/package.json +1 -1
- package/template/src/index.ts +18 -252
- package/template/src/postprocessors/modifyResponse.ts +21 -0
- package/template/src/preprocessors/messageMatching.ts +22 -0
- package/template/src/skills/basket.skill.ts +12 -0
- package/template/src/skills/product.skill.ts +13 -0
- package/template/src/{tools → skills/tools}/ProductsTool.ts +2 -1
- package/template/src/skills/tools/UserDataTool.ts +75 -0
- package/template/src/skills/user.skill.ts +13 -0
- package/template/src/seed.ts +0 -46
- package/template/src/tools/UserDataTool.ts +0 -33
- /package/template/src/{tools → skills/tools}/BasketTool.ts +0 -0
- /package/template/src/{tools → skills/tools}/CreateInlineJob.ts +0 -0
- /package/template/src/{tools → skills/tools}/CreatePostTool.ts +0 -0
- /package/template/src/{tools → skills/tools}/CustomDataTool.ts +0 -0
- /package/template/src/{tools → skills/tools}/GameScoreTrackerTool.ts +0 -0
- /package/template/src/{tools → skills/tools}/GetWeatherTool.ts +0 -0
- /package/template/src/{tools → skills/tools}/OrderTool.ts +0 -0
- /package/template/src/{tools → skills/tools}/PaymentTool.ts +0 -0
- /package/template/src/{tools → skills/tools}/SmartBasketTool.ts +0 -0
package/template/README.md
CHANGED
|
@@ -1,1084 +1,955 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 🤖 Lua AI Agent Template
|
|
2
2
|
|
|
3
|
-
Welcome to your Lua AI
|
|
3
|
+
Welcome to your Lua AI Agent! This is a fully-featured template to help you build, test, and deploy intelligent AI agents with custom tools, webhooks, scheduled jobs, and message processors.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## 🎯 What You Have
|
|
5
|
+
## 🎯 What You've Got
|
|
8
6
|
|
|
9
|
-
This
|
|
10
|
-
- ✅ **LuaAgent** - New simplified agent configuration (RECOMMENDED!)
|
|
11
|
-
- ✅ **7 Example Skills** - Pre-configured skill examples
|
|
12
|
-
- ✅ **30+ Example Tools** - Working tool implementations
|
|
13
|
-
- ✅ **2 Webhook Examples** - HTTP endpoints for external integrations
|
|
14
|
-
- ✅ **4 Job Examples** - Scheduled tasks (cron, interval, one-time)
|
|
15
|
-
- ✅ **Smart Basket Example** - Dynamic job creation from tools
|
|
16
|
-
- ✅ **All Platform APIs** - User, Products, Baskets, Orders, Custom Data, Webhooks, Jobs
|
|
17
|
-
- ✅ **TypeScript Setup** - Full type safety
|
|
18
|
-
- ✅ **Ready to Deploy** - Just customize and go!
|
|
7
|
+
This template includes **everything you need** to create a production-ready AI agent:
|
|
19
8
|
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
- ✅ **LuaAgent Configuration** - Unified agent setup with persona and welcome message
|
|
10
|
+
- ✅ **Example Skills & Tools** - 30+ pre-built tools demonstrating best practices
|
|
11
|
+
- ✅ **Webhooks** - HTTP endpoints for external integrations
|
|
12
|
+
- ✅ **Scheduled Jobs** - Automated background tasks
|
|
13
|
+
- ✅ **Message Processors** - Pre/post-process conversations
|
|
14
|
+
- ✅ **Type Safety** - Full TypeScript support with Zod validation
|
|
15
|
+
- ✅ **Testing Suite** - Local testing before deployment
|
|
16
|
+
- ✅ **CI/CD Ready** - Batch deployment commands
|
|
22
17
|
|
|
23
18
|
---
|
|
24
19
|
|
|
25
20
|
## 🚀 Quick Start
|
|
26
21
|
|
|
22
|
+
**New to Lua?** Start here:
|
|
23
|
+
|
|
27
24
|
```bash
|
|
28
|
-
# 1. Test
|
|
29
|
-
npm run test
|
|
30
|
-
# or
|
|
25
|
+
# 1. Test your tools locally
|
|
31
26
|
lua test
|
|
32
27
|
|
|
33
|
-
# 2.
|
|
34
|
-
|
|
35
|
-
# or
|
|
36
|
-
lua dev
|
|
37
|
-
|
|
38
|
-
# 3. Push to server
|
|
39
|
-
npm run push
|
|
40
|
-
# or
|
|
41
|
-
lua push
|
|
28
|
+
# 2. Chat with your agent (sandbox mode)
|
|
29
|
+
lua chat
|
|
42
30
|
|
|
43
|
-
#
|
|
44
|
-
lua deploy
|
|
31
|
+
# 3. Deploy to production
|
|
32
|
+
lua push all --force --auto-deploy
|
|
45
33
|
```
|
|
46
34
|
|
|
47
|
-
**
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## 📁 Project Structure
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
your-project/
|
|
55
|
-
├── src/
|
|
56
|
-
│ ├── index.ts # YOUR STARTING POINT - Define skills here
|
|
57
|
-
│ └── tools/ # Tool implementations
|
|
58
|
-
│ ├── GetWeatherTool.ts # External API example
|
|
59
|
-
│ ├── UserDataTool.ts # User API example
|
|
60
|
-
│ ├── ProductsTool.ts # Products API (6 tools)
|
|
61
|
-
│ ├── BasketTool.ts # Baskets API (9 tools)
|
|
62
|
-
│ ├── OrderTool.ts # Orders API (4 tools)
|
|
63
|
-
│ ├── CustomDataTool.ts # Custom Data API (6 tools)
|
|
64
|
-
│ ├── PaymentTool.ts # Payment integration
|
|
65
|
-
│ └── CreatePostTool.ts # Simple example
|
|
66
|
-
├── lua.skill.yaml # Configuration (auto-managed)
|
|
67
|
-
├── package.json # Dependencies
|
|
68
|
-
├── tsconfig.json # TypeScript config
|
|
69
|
-
├── .env # Environment variables (create this)
|
|
70
|
-
└── README.md # This file
|
|
71
|
-
```
|
|
35
|
+
👉 **[Read the Full Quick Start Guide →](QUICKSTART.md)**
|
|
72
36
|
|
|
73
37
|
---
|
|
74
38
|
|
|
75
|
-
##
|
|
39
|
+
## 📦 What's Inside
|
|
76
40
|
|
|
77
|
-
###
|
|
41
|
+
### Core Files
|
|
78
42
|
|
|
79
|
-
|
|
43
|
+
| File | Purpose |
|
|
44
|
+
|------|---------|
|
|
45
|
+
| `src/index.ts` | **Main file** - LuaAgent configuration |
|
|
46
|
+
| `lua.skill.yaml` | Agent metadata and component registry |
|
|
47
|
+
| `.env` | Environment variables (API keys, secrets) |
|
|
80
48
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
```typescript
|
|
84
|
-
import { LuaAgent, LuaSkill } from 'lua-cli';
|
|
49
|
+
### Directory Structure
|
|
85
50
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
51
|
+
```
|
|
52
|
+
src/
|
|
53
|
+
├── index.ts # 🎯 LuaAgent - Your agent's configuration
|
|
54
|
+
├── skills/ # Tools grouped by functionality
|
|
55
|
+
│ ├── tools/ # Individual tool implementations
|
|
56
|
+
│ │ ├── GetWeatherTool.ts # Example: External API integration
|
|
57
|
+
│ │ ├── ProductsTool.ts # Example: CRUD operations
|
|
58
|
+
│ │ ├── BasketTool.ts # Example: Shopping cart
|
|
59
|
+
│ │ └── SmartBasketTool.ts # Example: Complex tool with state
|
|
60
|
+
│ ├── product.skill.ts # Skill that groups product tools
|
|
61
|
+
│ └── basket.skill.ts # Skill that groups basket tools
|
|
62
|
+
├── webhooks/ # HTTP endpoints
|
|
63
|
+
│ ├── PaymentWebhook.ts # Example: Payment notifications
|
|
64
|
+
│ └── UserEventWebhook.ts # Example: External events
|
|
65
|
+
├── jobs/ # Scheduled tasks
|
|
66
|
+
│ ├── DailyCleanupJob.ts # Example: Recurring cleanup
|
|
67
|
+
│ └── HealthCheckJob.ts # Example: Monitoring job
|
|
68
|
+
├── preprocessors/ # Before-message processing
|
|
69
|
+
│ └── messageMatching.ts # Example: Route messages
|
|
70
|
+
└── postprocessors/ # After-response processing
|
|
71
|
+
└── modifyResponse.ts # Example: Format responses
|
|
94
72
|
```
|
|
95
73
|
|
|
96
|
-
|
|
74
|
+
---
|
|
97
75
|
|
|
98
|
-
|
|
76
|
+
## 🤖 Your Agent at a Glance
|
|
99
77
|
|
|
100
|
-
|
|
78
|
+
Your agent is configured in `src/index.ts`:
|
|
101
79
|
|
|
102
80
|
```typescript
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
81
|
+
export const agent = new LuaAgent({
|
|
82
|
+
name: 'your-agent-name',
|
|
83
|
+
persona: 'Your agent personality and behavior...',
|
|
84
|
+
welcomeMessage: 'First message users see',
|
|
85
|
+
|
|
86
|
+
skills: [
|
|
87
|
+
generalSkill, // Weather, posts, utils
|
|
88
|
+
userSkill, // User data management
|
|
89
|
+
productSkill, // Product operations
|
|
90
|
+
basketSkill, // Shopping cart
|
|
91
|
+
orderSkill, // Order processing
|
|
92
|
+
customDataSkill, // Custom data storage
|
|
93
|
+
paymentSkill // Payment processing
|
|
94
|
+
],
|
|
95
|
+
|
|
96
|
+
webhooks: [
|
|
97
|
+
// paymentWebhook, // Uncomment to enable
|
|
98
|
+
],
|
|
99
|
+
|
|
100
|
+
jobs: [
|
|
101
|
+
// dailyCleanupJob, // Uncomment to enable
|
|
102
|
+
],
|
|
103
|
+
|
|
104
|
+
preProcessors: [
|
|
105
|
+
// messageMatchingProcessor, // Uncomment to enable
|
|
106
|
+
],
|
|
107
|
+
|
|
108
|
+
postProcessors: [
|
|
109
|
+
// responseModifierProcessor, // Uncomment to enable
|
|
112
110
|
]
|
|
113
111
|
});
|
|
114
112
|
```
|
|
115
113
|
|
|
116
|
-
**You have 7 skills pre-configured:**
|
|
117
|
-
1. `general-skill` - Weather and posts
|
|
118
|
-
2. `user-data-skill` - User management
|
|
119
|
-
3. `product-skill` - Product catalog
|
|
120
|
-
4. `basket-skill` - Shopping carts
|
|
121
|
-
5. `order-skill` - Order processing
|
|
122
|
-
6. `custom-data-skill` - Custom data (movies example)
|
|
123
|
-
7. `payment-skill` - Payment links
|
|
124
|
-
|
|
125
114
|
---
|
|
126
115
|
|
|
127
|
-
|
|
116
|
+
## 🛠️ Example Tools Included
|
|
128
117
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
118
|
+
### General Purpose
|
|
119
|
+
- **get_weather** - Fetch weather data from external API
|
|
120
|
+
- **create_post** - Create posts with external service
|
|
121
|
+
- **create_inline_job** - Demonstrates dynamic job creation
|
|
122
|
+
|
|
123
|
+
### User Management
|
|
124
|
+
- **get_user_data** - Retrieve user information
|
|
125
|
+
- **update_user_data** - Update user profiles
|
|
132
126
|
|
|
133
|
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
-
|
|
127
|
+
### E-commerce
|
|
128
|
+
- **search_products** - Search product catalog
|
|
129
|
+
- **create_product** - Add new products
|
|
130
|
+
- **update_product** - Modify existing products
|
|
131
|
+
- **delete_product** - Remove products
|
|
132
|
+
- **create_basket** - Create shopping cart
|
|
133
|
+
- **add_item_to_basket** - Add products to cart
|
|
134
|
+
- **checkout_basket** - Complete purchase
|
|
135
|
+
- **create_order** - Place orders
|
|
136
|
+
- **update_order_status** - Track order progress
|
|
137
|
+
|
|
138
|
+
### Advanced Examples
|
|
139
|
+
- **smart_basket_tool** - Complex state management with AI-powered recommendations
|
|
140
|
+
- **game_score_tracker** - Multi-player game tracking with leaderboards
|
|
141
|
+
- **create_payment_link** - Stripe integration for payments
|
|
138
142
|
|
|
139
143
|
---
|
|
140
144
|
|
|
141
|
-
|
|
145
|
+
## 🎓 Learning Path
|
|
142
146
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
147
|
+
### Beginner
|
|
148
|
+
1. ✅ Read [QUICKSTART.md](QUICKSTART.md)
|
|
149
|
+
2. ✅ Run `lua test` to try existing tools
|
|
150
|
+
3. ✅ Run `lua chat` to interact with your agent
|
|
151
|
+
4. ✅ Modify the agent persona in `src/index.ts`
|
|
146
152
|
|
|
147
|
-
|
|
153
|
+
### Intermediate
|
|
154
|
+
1. ✅ Create your first custom tool
|
|
155
|
+
2. ✅ Group tools into a skill
|
|
156
|
+
3. ✅ Add the skill to your LuaAgent
|
|
157
|
+
4. ✅ Test and deploy with `lua push`
|
|
148
158
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
159
|
+
### Advanced
|
|
160
|
+
1. ✅ Create webhooks for external integrations
|
|
161
|
+
2. ✅ Schedule jobs for automated tasks
|
|
162
|
+
3. ✅ Add preprocessors to route/filter messages
|
|
163
|
+
4. ✅ Use postprocessors to format responses
|
|
164
|
+
5. ✅ Implement complex tools with external APIs
|
|
154
165
|
|
|
155
166
|
---
|
|
156
167
|
|
|
157
|
-
|
|
168
|
+
## 🔑 Key Features
|
|
158
169
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
Edit `src/tools/GetWeatherTool.ts`:
|
|
170
|
+
### Intelligent Tools
|
|
171
|
+
Your agent can use tools to accomplish tasks:
|
|
162
172
|
```typescript
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
// Add your customization
|
|
167
|
-
return {
|
|
168
|
-
...weather,
|
|
169
|
-
recommendation: this.getClothingAdvice(weather.temperature)
|
|
170
|
-
};
|
|
171
|
-
}
|
|
173
|
+
// User: "What's the weather in Tokyo?"
|
|
174
|
+
// Agent uses: get_weather tool
|
|
175
|
+
// Response: "It's 72°F and sunny in Tokyo"
|
|
172
176
|
```
|
|
173
177
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
Clean up `src/index.ts`:
|
|
178
|
+
### External Integrations
|
|
179
|
+
Connect to any API:
|
|
177
180
|
```typescript
|
|
178
|
-
//
|
|
179
|
-
|
|
181
|
+
// Stripe, OpenAI, Pinecone, custom APIs
|
|
182
|
+
const result = await axios.post(API_URL, data);
|
|
183
|
+
```
|
|
180
184
|
|
|
181
|
-
|
|
182
|
-
|
|
185
|
+
### User Context
|
|
186
|
+
Access user data in every tool:
|
|
187
|
+
```typescript
|
|
188
|
+
const user = await User.get();
|
|
189
|
+
const preferences = user.preferences;
|
|
190
|
+
```
|
|
183
191
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
new GetWeatherTool()
|
|
191
|
-
// Add your tools
|
|
192
|
-
]
|
|
192
|
+
### Persistent Storage
|
|
193
|
+
Store data across conversations:
|
|
194
|
+
```typescript
|
|
195
|
+
await Data.create('notes', {
|
|
196
|
+
title: "Meeting Notes",
|
|
197
|
+
content: "..."
|
|
193
198
|
});
|
|
194
199
|
```
|
|
195
200
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
Create `src/tools/MyTool.ts`:
|
|
201
|
+
### Scheduled Automation
|
|
202
|
+
Run tasks on a schedule:
|
|
199
203
|
```typescript
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
name = "my_tool";
|
|
205
|
-
description = "What my tool does";
|
|
206
|
-
|
|
207
|
-
inputSchema = z.object({
|
|
208
|
-
param: z.string()
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
async execute(input: z.infer<typeof this.inputSchema>) {
|
|
212
|
-
// Your logic here
|
|
213
|
-
return { success: true };
|
|
214
|
-
}
|
|
204
|
+
// Every day at 9 AM
|
|
205
|
+
schedule: {
|
|
206
|
+
type: "cron",
|
|
207
|
+
pattern: "0 9 * * *"
|
|
215
208
|
}
|
|
216
209
|
```
|
|
217
210
|
|
|
218
|
-
|
|
211
|
+
### Real-time Events
|
|
212
|
+
Receive HTTP webhooks:
|
|
219
213
|
```typescript
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
const mySkill = new LuaSkill({
|
|
223
|
-
tools: [new MyTool()]
|
|
224
|
-
});
|
|
214
|
+
// POST /webhook/{webhookId}
|
|
215
|
+
// Process payment confirmations, order updates, etc.
|
|
225
216
|
```
|
|
226
217
|
|
|
227
218
|
---
|
|
228
219
|
|
|
229
|
-
##
|
|
220
|
+
## 📊 Development Workflow
|
|
230
221
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
---
|
|
245
|
-
|
|
246
|
-
### UserDataTool.ts
|
|
247
|
-
**What it does:** Gets and updates user data (2 tools)
|
|
222
|
+
```mermaid
|
|
223
|
+
graph LR
|
|
224
|
+
A[Write Code] --> B[lua test]
|
|
225
|
+
B --> C[lua chat sandbox]
|
|
226
|
+
C --> D{Works?}
|
|
227
|
+
D -->|No| A
|
|
228
|
+
D -->|Yes| E[lua compile]
|
|
229
|
+
E --> F[lua push]
|
|
230
|
+
F --> G[lua chat production]
|
|
231
|
+
G --> H{Deploy?}
|
|
232
|
+
H -->|Yes| I[lua deploy]
|
|
233
|
+
H -->|No| A
|
|
234
|
+
```
|
|
248
235
|
|
|
249
|
-
|
|
250
|
-
- Using Platform APIs (`User`)
|
|
251
|
-
- Simple CRUD operations
|
|
252
|
-
- Data retrieval and updates
|
|
236
|
+
### Commands Reference
|
|
253
237
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
238
|
+
| Command | Purpose | When to Use |
|
|
239
|
+
|---------|---------|-------------|
|
|
240
|
+
| `lua test` | Test individual tools | During development |
|
|
241
|
+
| `lua chat` | Interactive testing | Validate tool interactions |
|
|
242
|
+
| `lua compile` | Bundle your code | Before pushing |
|
|
243
|
+
| `lua push` | Upload to server | Ready to deploy |
|
|
244
|
+
| `lua deploy` | Publish to production | Make live for users |
|
|
245
|
+
| `lua push all --force` | Batch push all | CI/CD pipelines |
|
|
258
246
|
|
|
259
247
|
---
|
|
260
248
|
|
|
261
|
-
|
|
262
|
-
**What it does:** Complete product management (6 tools)
|
|
263
|
-
|
|
264
|
-
**Learn from this:**
|
|
265
|
-
- Full CRUD operations
|
|
266
|
-
- Search functionality
|
|
267
|
-
- Pagination handling
|
|
268
|
-
- Platform API usage
|
|
249
|
+
## 🔒 Environment Variables
|
|
269
250
|
|
|
270
|
-
|
|
271
|
-
- `search_products` - Search catalog
|
|
272
|
-
- `get_all_products` - List with pagination
|
|
273
|
-
- `create_product` - Add new products
|
|
274
|
-
- `update_product` - Modify existing
|
|
275
|
-
- `get_product_by_id` - Get specific product
|
|
276
|
-
- `delete_product` - Remove products
|
|
251
|
+
Store sensitive data in `.env`:
|
|
277
252
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
- Product recommendations
|
|
282
|
-
|
|
283
|
-
---
|
|
253
|
+
```bash
|
|
254
|
+
# Copy from example
|
|
255
|
+
cp env.example .env
|
|
284
256
|
|
|
285
|
-
|
|
286
|
-
|
|
257
|
+
# Add your API keys
|
|
258
|
+
OPENAI_API_KEY=sk-...
|
|
259
|
+
STRIPE_SECRET_KEY=sk_live_...
|
|
260
|
+
PINECONE_API_KEY=...
|
|
287
261
|
|
|
288
|
-
|
|
289
|
-
-
|
|
290
|
-
|
|
291
|
-
- Complex business logic
|
|
262
|
+
# Optional: For CI/CD
|
|
263
|
+
LUA_API_KEY=your-lua-api-key
|
|
264
|
+
```
|
|
292
265
|
|
|
293
|
-
**
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
- `remove_from_basket` - Remove items
|
|
298
|
-
- `clear_basket` - Empty cart
|
|
299
|
-
- `update_basket_status` - Change status
|
|
300
|
-
- `update_basket_metadata` - Add metadata
|
|
301
|
-
- `checkout_basket` - Convert to order
|
|
302
|
-
- `get_basket_by_id` - Get specific basket
|
|
303
|
-
|
|
304
|
-
**Use it for:**
|
|
305
|
-
- Shopping carts
|
|
306
|
-
- Temporary storage
|
|
307
|
-
- Multi-item collections
|
|
266
|
+
**Priority:**
|
|
267
|
+
1. System keychain (most secure)
|
|
268
|
+
2. `LUA_API_KEY` environment variable
|
|
269
|
+
3. `.env` file
|
|
308
270
|
|
|
309
271
|
---
|
|
310
272
|
|
|
311
|
-
|
|
312
|
-
**What it does:** Order creation and tracking (4 tools)
|
|
313
|
-
|
|
314
|
-
**Learn from this:**
|
|
315
|
-
- Order fulfillment flows
|
|
316
|
-
- Status management
|
|
317
|
-
- Basket-to-order conversion
|
|
273
|
+
## 🎨 Customization Guide
|
|
318
274
|
|
|
319
|
-
|
|
320
|
-
- Order processing
|
|
321
|
-
- Purchase completion
|
|
322
|
-
- Order tracking
|
|
275
|
+
### 1. Update Agent Identity
|
|
323
276
|
|
|
324
|
-
|
|
277
|
+
Edit `src/index.ts`:
|
|
325
278
|
|
|
326
|
-
### CustomDataTool.ts
|
|
327
|
-
**What it does:** Movie database with vector search (6 tools)
|
|
328
|
-
|
|
329
|
-
**Learn from this:**
|
|
330
|
-
- **Vector search** - Semantic similarity search
|
|
331
|
-
- Custom data collections
|
|
332
|
-
- Search indexing
|
|
333
|
-
- CRUD on custom schemas
|
|
334
|
-
|
|
335
|
-
**Tools included:**
|
|
336
|
-
- `create_movie` - Add movie with search indexing
|
|
337
|
-
- `get_movies` - List all movies
|
|
338
|
-
- `get_movie_by_id` - Get specific movie
|
|
339
|
-
- `update_movie` - Modify movie data
|
|
340
|
-
- `search_movies` - **Semantic search** (find similar)
|
|
341
|
-
- `delete_movie` - Remove movie
|
|
342
|
-
|
|
343
|
-
**Use it for:**
|
|
344
|
-
- Knowledge bases
|
|
345
|
-
- Document search
|
|
346
|
-
- FAQs
|
|
347
|
-
- Any searchable content
|
|
348
|
-
- Recommendation systems
|
|
349
|
-
|
|
350
|
-
**Vector Search Example:**
|
|
351
279
|
```typescript
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
280
|
+
export const agent = new LuaAgent({
|
|
281
|
+
name: 'my-customer-support-bot', // ✏️ Change this
|
|
282
|
+
|
|
283
|
+
persona: `You are Sarah, a friendly customer support agent...`, // ✏️ Customize
|
|
284
|
+
|
|
285
|
+
welcomeMessage: 'Hi! I\'m Sarah. How can I help you today?', // ✏️ Personalize
|
|
286
|
+
|
|
287
|
+
// ...
|
|
288
|
+
});
|
|
361
289
|
```
|
|
362
290
|
|
|
363
|
-
|
|
291
|
+
### 2. Add Your Own Tool
|
|
364
292
|
|
|
365
|
-
|
|
366
|
-
**What it does:** Creates payment links (Stripe example)
|
|
293
|
+
Create `src/skills/tools/MyTool.ts`:
|
|
367
294
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
- Payment processing
|
|
295
|
+
```typescript
|
|
296
|
+
import { LuaTool } from "lua-cli/skill";
|
|
297
|
+
import { z } from "zod";
|
|
372
298
|
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
299
|
+
export default class MyTool implements LuaTool {
|
|
300
|
+
name = "my_tool";
|
|
301
|
+
description = "What this tool does";
|
|
302
|
+
|
|
303
|
+
inputSchema = z.object({
|
|
304
|
+
param: z.string()
|
|
305
|
+
});
|
|
377
306
|
|
|
378
|
-
|
|
307
|
+
async execute(input: z.infer<typeof this.inputSchema>) {
|
|
308
|
+
// Your logic here
|
|
309
|
+
return { result: "success" };
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
```
|
|
379
313
|
|
|
380
|
-
|
|
381
|
-
**What it does:** Simple example tool
|
|
314
|
+
Add to a skill in `src/index.ts`:
|
|
382
315
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
- Minimal implementation
|
|
386
|
-
- Good starting point
|
|
316
|
+
```typescript
|
|
317
|
+
import MyTool from './skills/tools/MyTool';
|
|
387
318
|
|
|
388
|
-
|
|
319
|
+
const mySkill = new LuaSkill({
|
|
320
|
+
name: 'my-skill',
|
|
321
|
+
description: 'My custom skill',
|
|
322
|
+
context: 'Use these tools for...',
|
|
323
|
+
tools: [new MyTool()]
|
|
324
|
+
});
|
|
389
325
|
|
|
390
|
-
|
|
326
|
+
export const agent = new LuaAgent({
|
|
327
|
+
// ...
|
|
328
|
+
skills: [...existingSkills, mySkill],
|
|
329
|
+
});
|
|
330
|
+
```
|
|
391
331
|
|
|
392
|
-
###
|
|
332
|
+
### 3. Configure Webhooks
|
|
393
333
|
|
|
394
|
-
|
|
334
|
+
Uncomment in `src/index.ts`:
|
|
395
335
|
|
|
396
|
-
1. **Update `src/index.ts`:**
|
|
397
336
|
```typescript
|
|
398
|
-
import
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
version: "1.0.0",
|
|
404
|
-
description: "Product search and management",
|
|
405
|
-
context: "Use search_products to find items. Use create_product to add new items.",
|
|
406
|
-
tools: [
|
|
407
|
-
new SearchProductsTool(),
|
|
408
|
-
new CreateProductTool()
|
|
409
|
-
]
|
|
337
|
+
import paymentWebhook from './webhooks/PaymentWebhook';
|
|
338
|
+
|
|
339
|
+
export const agent = new LuaAgent({
|
|
340
|
+
// ...
|
|
341
|
+
webhooks: [paymentWebhook], // ✅ Enabled
|
|
410
342
|
});
|
|
411
343
|
```
|
|
412
344
|
|
|
413
|
-
|
|
414
|
-
```bash
|
|
415
|
-
rm src/tools/BasketTool.ts
|
|
416
|
-
rm src/tools/OrderTool.ts
|
|
417
|
-
rm src/tools/CustomDataTool.ts
|
|
418
|
-
# Keep only ProductsTool.ts
|
|
345
|
+
Get your webhook URL after deployment:
|
|
419
346
|
```
|
|
420
|
-
|
|
421
|
-
3. **Test:**
|
|
422
|
-
```bash
|
|
423
|
-
lua test
|
|
347
|
+
https://webhook.heylua.ai/{agentId}/{webhookId}
|
|
424
348
|
```
|
|
425
349
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
### Scenario 2: Build a Restaurant Skill
|
|
429
|
-
|
|
430
|
-
1. **Rename tools to match your domain:**
|
|
350
|
+
### 4. Schedule Jobs
|
|
431
351
|
|
|
432
|
-
|
|
352
|
+
Uncomment in `src/index.ts`:
|
|
433
353
|
|
|
434
|
-
2. **Update tool names and descriptions:**
|
|
435
354
|
```typescript
|
|
436
|
-
|
|
437
|
-
name = "create_menu_item";
|
|
438
|
-
description = "Add a new item to the restaurant menu";
|
|
439
|
-
|
|
440
|
-
inputSchema = z.object({
|
|
441
|
-
name: z.string(),
|
|
442
|
-
category: z.enum(['appetizers', 'mains', 'desserts', 'drinks']),
|
|
443
|
-
price: z.number(),
|
|
444
|
-
description: z.string()
|
|
445
|
-
});
|
|
446
|
-
|
|
447
|
-
async execute(input: any) {
|
|
448
|
-
const searchText = `${input.name} ${input.category} ${input.description}`;
|
|
449
|
-
return await Data.create('menu_items', input, searchText);
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
```
|
|
355
|
+
import dailyCleanupJob from './jobs/DailyCleanupJob';
|
|
453
356
|
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
description: "Restaurant assistant for menu, orders, and reservations",
|
|
458
|
-
context: `
|
|
459
|
-
Help customers interact with the restaurant.
|
|
460
|
-
|
|
461
|
-
- Use show_menu when asked about food or drinks
|
|
462
|
-
- Use create_order when taking orders (confirm items first)
|
|
463
|
-
- Use make_reservation for table bookings
|
|
464
|
-
|
|
465
|
-
Always mention daily specials.
|
|
466
|
-
Confirm order details before submitting.
|
|
467
|
-
`,
|
|
468
|
-
tools: [new ShowMenuTool(), new CreateOrderTool()]
|
|
357
|
+
export const agent = new LuaAgent({
|
|
358
|
+
// ...
|
|
359
|
+
jobs: [dailyCleanupJob], // ✅ Enabled
|
|
469
360
|
});
|
|
470
361
|
```
|
|
471
362
|
|
|
472
363
|
---
|
|
473
364
|
|
|
474
|
-
|
|
365
|
+
## 📚 Documentation
|
|
475
366
|
|
|
476
|
-
|
|
367
|
+
### Comprehensive Guides
|
|
368
|
+
- **[Quick Start Guide](QUICKSTART.md)** - Step-by-step tutorial
|
|
369
|
+
- **[Example Skills](src/skills/)** - Browse working examples
|
|
370
|
+
- **[Example Webhooks](src/webhooks/)** - Webhook patterns
|
|
371
|
+
- **[Example Jobs](src/jobs/)** - Job scheduling examples
|
|
477
372
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
export class CreateCustomerTool implements LuaTool {
|
|
484
|
-
name = "create_customer";
|
|
485
|
-
description = "Add a new customer to CRM";
|
|
486
|
-
|
|
487
|
-
inputSchema = z.object({
|
|
488
|
-
name: z.string(),
|
|
489
|
-
email: z.string().email(),
|
|
490
|
-
company: z.string().optional(),
|
|
491
|
-
phone: z.string().optional()
|
|
492
|
-
});
|
|
373
|
+
### Official Documentation
|
|
374
|
+
- **Lua Docs:** https://docs.heylua.ai
|
|
375
|
+
- **CLI Reference:** https://github.com/heylua/lua-cli
|
|
376
|
+
- **Community:** https://community.heylua.ai
|
|
493
377
|
|
|
494
|
-
|
|
495
|
-
const searchText = `${input.name} ${input.email} ${input.company || ''}`;
|
|
496
|
-
|
|
497
|
-
const customer = await Data.create('customers', {
|
|
498
|
-
...input,
|
|
499
|
-
status: 'active',
|
|
500
|
-
createdAt: new Date().toISOString()
|
|
501
|
-
}, searchText);
|
|
502
|
-
|
|
503
|
-
return {
|
|
504
|
-
customerId: customer.id,
|
|
505
|
-
message: `Customer ${input.name} added to CRM`
|
|
506
|
-
};
|
|
507
|
-
}
|
|
508
|
-
}
|
|
378
|
+
---
|
|
509
379
|
|
|
510
|
-
|
|
511
|
-
name = "search_customers";
|
|
512
|
-
description = "Search customers by name, email, or company";
|
|
513
|
-
inputSchema = z.object({ query: z.string() });
|
|
514
|
-
|
|
515
|
-
async execute(input: any) {
|
|
516
|
-
const results = await Data.search('customers', input.query, 10, 0.7);
|
|
517
|
-
|
|
518
|
-
return {
|
|
519
|
-
customers: results.data.map(entry => ({
|
|
520
|
-
id: entry.id,
|
|
521
|
-
...entry.data,
|
|
522
|
-
relevance: entry.score
|
|
523
|
-
}))
|
|
524
|
-
};
|
|
525
|
-
}
|
|
526
|
-
}
|
|
527
|
-
```
|
|
380
|
+
## 🧪 Testing Strategy
|
|
528
381
|
|
|
529
|
-
|
|
382
|
+
### Local Testing (Recommended)
|
|
530
383
|
|
|
531
|
-
```
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
description = "Log customer interaction";
|
|
535
|
-
|
|
536
|
-
inputSchema = z.object({
|
|
537
|
-
customerId: z.string(),
|
|
538
|
-
type: z.enum(['call', 'email', 'meeting']),
|
|
539
|
-
notes: z.string()
|
|
540
|
-
});
|
|
384
|
+
```bash
|
|
385
|
+
# Test individual tools
|
|
386
|
+
lua test
|
|
541
387
|
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
type: input.type,
|
|
546
|
-
notes: input.notes,
|
|
547
|
-
timestamp: new Date().toISOString()
|
|
548
|
-
}, `${input.type} ${input.notes}`);
|
|
549
|
-
|
|
550
|
-
return { success: true };
|
|
551
|
-
}
|
|
552
|
-
}
|
|
388
|
+
# Interactive chat testing
|
|
389
|
+
lua chat
|
|
390
|
+
# Select: Sandbox
|
|
553
391
|
```
|
|
554
392
|
|
|
555
|
-
|
|
393
|
+
**Why sandbox?**
|
|
394
|
+
- ✅ Uses your local code (not deployed)
|
|
395
|
+
- ✅ Safe for experimentation
|
|
396
|
+
- ✅ Instant feedback
|
|
397
|
+
- ✅ No production impact
|
|
556
398
|
|
|
557
|
-
|
|
399
|
+
### Production Testing
|
|
558
400
|
|
|
559
401
|
```bash
|
|
560
|
-
|
|
561
|
-
|
|
402
|
+
lua chat
|
|
403
|
+
# Select: Production
|
|
404
|
+
```
|
|
562
405
|
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
406
|
+
**When to use:**
|
|
407
|
+
- ✅ After deploying
|
|
408
|
+
- ✅ Validate production behavior
|
|
409
|
+
- ✅ Test with real data
|
|
567
410
|
|
|
568
|
-
|
|
569
|
-
npm run dev
|
|
570
|
-
# or
|
|
571
|
-
lua dev
|
|
411
|
+
---
|
|
572
412
|
|
|
573
|
-
|
|
574
|
-
npm run compile
|
|
575
|
-
# or
|
|
576
|
-
lua compile
|
|
413
|
+
## 🚀 Deployment Options
|
|
577
414
|
|
|
578
|
-
|
|
579
|
-
npm run push
|
|
580
|
-
# or
|
|
581
|
-
lua push
|
|
415
|
+
### Option 1: Interactive (Recommended for First Time)
|
|
582
416
|
|
|
583
|
-
|
|
584
|
-
lua
|
|
417
|
+
```bash
|
|
418
|
+
lua push
|
|
419
|
+
# Select component type
|
|
420
|
+
# Confirm version
|
|
421
|
+
# Choose whether to deploy
|
|
585
422
|
```
|
|
586
423
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
424
|
+
**Best for:**
|
|
425
|
+
- Learning the deployment process
|
|
426
|
+
- Reviewing changes before deploying
|
|
427
|
+
- Fine-grained control
|
|
590
428
|
|
|
591
|
-
###
|
|
429
|
+
### Option 2: Batch Deployment (CI/CD)
|
|
592
430
|
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
- Skill IDs (auto-created during compilation)
|
|
596
|
-
- Optional environment variables
|
|
597
|
-
|
|
598
|
-
```yaml
|
|
599
|
-
agent:
|
|
600
|
-
agentId: agent_abc123
|
|
601
|
-
orgId: org_xyz789
|
|
602
|
-
|
|
603
|
-
skills:
|
|
604
|
-
- name: my-skill
|
|
605
|
-
version: 1.0.0
|
|
606
|
-
skillId: skill_xyz789 # Auto-created
|
|
431
|
+
```bash
|
|
432
|
+
lua push all --force --auto-deploy
|
|
607
433
|
```
|
|
608
434
|
|
|
609
|
-
**
|
|
435
|
+
**What happens:**
|
|
436
|
+
1. Compiles all code
|
|
437
|
+
2. Auto-bumps patch versions
|
|
438
|
+
3. Pushes all skills, webhooks, jobs, processors
|
|
439
|
+
4. Deploys everything to production
|
|
440
|
+
|
|
441
|
+
**Best for:**
|
|
442
|
+
- CI/CD pipelines
|
|
443
|
+
- Batch updates
|
|
444
|
+
- Production deployments
|
|
610
445
|
|
|
611
446
|
---
|
|
612
447
|
|
|
613
|
-
|
|
448
|
+
## 💡 Pro Tips
|
|
614
449
|
|
|
615
|
-
|
|
450
|
+
### Development
|
|
451
|
+
- ✅ Use `lua test` frequently during development
|
|
452
|
+
- ✅ Test in sandbox before deploying
|
|
453
|
+
- ✅ Keep tools small and focused (single responsibility)
|
|
454
|
+
- ✅ Use TypeScript for better error catching
|
|
616
455
|
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
# Configuration
|
|
624
|
-
API_BASE_URL=https://api.example.com
|
|
625
|
-
ENABLE_DEBUG=false
|
|
626
|
-
```
|
|
456
|
+
### Tools
|
|
457
|
+
- ✅ Validate all inputs with Zod schemas
|
|
458
|
+
- ✅ Return structured objects (not just strings)
|
|
459
|
+
- ✅ Handle errors gracefully
|
|
460
|
+
- ✅ Use descriptive names and descriptions (the AI reads these!)
|
|
627
461
|
|
|
628
|
-
|
|
462
|
+
### Jobs
|
|
463
|
+
- ✅ Always pass data via `metadata` field
|
|
464
|
+
- ✅ Make execute functions self-contained
|
|
465
|
+
- ✅ Use appropriate schedule types (once, cron, interval)
|
|
466
|
+
- ✅ Test job logic in regular tools first
|
|
629
467
|
|
|
630
|
-
|
|
468
|
+
### Webhooks
|
|
469
|
+
- ✅ Validate signatures in production
|
|
470
|
+
- ✅ Return proper HTTP status codes
|
|
471
|
+
- ✅ Handle retries and idempotency
|
|
472
|
+
- ✅ Test with tools like Postman first
|
|
631
473
|
|
|
632
|
-
###
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
{
|
|
638
|
-
"name": "your-skill-name",
|
|
639
|
-
"version": "1.0.0",
|
|
640
|
-
"scripts": {
|
|
641
|
-
"test": "lua test",
|
|
642
|
-
"dev": "lua dev",
|
|
643
|
-
"compile": "lua compile",
|
|
644
|
-
"push": "lua push"
|
|
645
|
-
},
|
|
646
|
-
"dependencies": {
|
|
647
|
-
"lua-cli": "^2.0.0",
|
|
648
|
-
"zod": "^3.0.0"
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
```
|
|
474
|
+
### Agent Persona
|
|
475
|
+
- ✅ Be specific about personality and tone
|
|
476
|
+
- ✅ Define what the agent can/cannot do
|
|
477
|
+
- ✅ Give examples of good responses
|
|
478
|
+
- ✅ Update based on user feedback
|
|
652
479
|
|
|
653
480
|
---
|
|
654
481
|
|
|
655
|
-
##
|
|
482
|
+
## 🔄 Keeping Your Agent Updated
|
|
656
483
|
|
|
657
|
-
###
|
|
484
|
+
### When You Make Changes
|
|
658
485
|
|
|
659
|
-
**Try each tool:**
|
|
660
486
|
```bash
|
|
487
|
+
# 1. Test your changes
|
|
661
488
|
lua test
|
|
662
|
-
```
|
|
663
489
|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
- Test `search_movies` - See vector search
|
|
667
|
-
- Test `create_basket` → `add_to_basket` → `checkout_basket` - See workflows
|
|
490
|
+
# 2. Compile
|
|
491
|
+
lua compile
|
|
668
492
|
|
|
669
|
-
|
|
493
|
+
# 3. Push new version
|
|
494
|
+
lua push
|
|
670
495
|
|
|
671
|
-
|
|
496
|
+
# 4. Deploy when ready
|
|
497
|
+
lua deploy
|
|
498
|
+
```
|
|
672
499
|
|
|
673
|
-
|
|
674
|
-
- Start with simple ones (`GetWeatherTool.ts`, `CreatePostTool.ts`)
|
|
675
|
-
- Then explore complex ones (`BasketTool.ts`, `ProductsTool.ts`)
|
|
676
|
-
- Study vector search (`CustomDataTool.ts`)
|
|
500
|
+
### Sync Your Configuration
|
|
677
501
|
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
- `
|
|
681
|
-
- `
|
|
682
|
-
-
|
|
502
|
+
The CLI automatically keeps your `lua.skill.yaml` and `LuaAgent` in sync:
|
|
503
|
+
|
|
504
|
+
- **Run `lua init`** → Syncs agent name, persona, welcomeMessage to both files
|
|
505
|
+
- **Run `lua compile`** → Syncs LuaAgent changes back to YAML
|
|
506
|
+
- **Manual edit YAML** → Re-run `lua compile` to rebuild
|
|
683
507
|
|
|
684
508
|
---
|
|
685
509
|
|
|
686
|
-
|
|
510
|
+
## 🎨 Example Use Cases
|
|
687
511
|
|
|
688
|
-
|
|
512
|
+
### Customer Support Agent
|
|
513
|
+
```typescript
|
|
514
|
+
persona: `You are Alex, a patient and knowledgeable customer support agent.
|
|
515
|
+
You help customers with orders, returns, and product questions.
|
|
516
|
+
Always be empathetic and solution-oriented.`
|
|
689
517
|
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
- Movies → Your data type
|
|
693
|
-
- Products → Your catalog
|
|
694
|
-
- Weather → Your external API
|
|
518
|
+
skills: [productSkill, orderSkill, basketSkill]
|
|
519
|
+
```
|
|
695
520
|
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
521
|
+
### E-commerce Assistant
|
|
522
|
+
```typescript
|
|
523
|
+
persona: `You are Sophia, an enthusiastic shopping assistant.
|
|
524
|
+
You help customers find products, make recommendations, and complete purchases.
|
|
525
|
+
Use a friendly, upbeat tone and be proactive with suggestions.`
|
|
526
|
+
|
|
527
|
+
skills: [productSkill, basketSkill, paymentSkill]
|
|
701
528
|
```
|
|
702
529
|
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
-
|
|
708
|
-
|
|
530
|
+
### Data Analysis Agent
|
|
531
|
+
```typescript
|
|
532
|
+
persona: `You are DataBot, an analytical AI assistant.
|
|
533
|
+
You help users query data, generate reports, and visualize insights.
|
|
534
|
+
Be precise, data-driven, and thorough in your analysis.`
|
|
535
|
+
|
|
536
|
+
skills: [customDataSkill, analyticsSkill, reportSkill]
|
|
537
|
+
```
|
|
709
538
|
|
|
710
539
|
---
|
|
711
540
|
|
|
712
|
-
|
|
541
|
+
## 🔐 Security Best Practices
|
|
713
542
|
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
543
|
+
### API Keys
|
|
544
|
+
- ✅ Never commit `.env` file to version control
|
|
545
|
+
- ✅ Use `.env.example` as a template
|
|
546
|
+
- ✅ Rotate API keys regularly
|
|
547
|
+
- ✅ Use environment-specific keys (sandbox vs production)
|
|
718
548
|
|
|
719
|
-
|
|
720
|
-
|
|
549
|
+
### Webhooks
|
|
550
|
+
- ✅ Validate webhook signatures in production
|
|
551
|
+
- ✅ Use HTTPS endpoints only
|
|
552
|
+
- ✅ Rate limit webhook handlers
|
|
553
|
+
- ✅ Log all webhook events
|
|
721
554
|
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
555
|
+
### User Data
|
|
556
|
+
- ✅ Only store necessary data
|
|
557
|
+
- ✅ Encrypt sensitive information
|
|
558
|
+
- ✅ Respect user privacy preferences
|
|
559
|
+
- ✅ Implement data deletion on request
|
|
725
560
|
|
|
726
561
|
---
|
|
727
562
|
|
|
728
|
-
##
|
|
729
|
-
|
|
730
|
-
### In This Project
|
|
731
|
-
- **README.md** - This file (project overview)
|
|
732
|
-
- **QUICKSTART.md** - 5-minute start guide
|
|
733
|
-
- **TOOL_EXAMPLES.md** - Detailed tool explanations
|
|
563
|
+
## 🐛 Troubleshooting
|
|
734
564
|
|
|
735
|
-
###
|
|
736
|
-
- **Getting Started** - Complete tutorial
|
|
737
|
-
- **API Reference** - All platform APIs
|
|
738
|
-
- **CLI Reference** - All commands
|
|
739
|
-
- **Template Guide** - This template explained
|
|
565
|
+
### Common Issues
|
|
740
566
|
|
|
741
|
-
**
|
|
567
|
+
**"Tool not found by agent"**
|
|
742
568
|
```bash
|
|
743
|
-
#
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
# Or online
|
|
747
|
-
https://docs.heylua.ai
|
|
569
|
+
# Make sure tool is in a skill, skill is in LuaAgent
|
|
570
|
+
lua compile # Rebuilds everything
|
|
748
571
|
```
|
|
749
572
|
|
|
750
|
-
|
|
573
|
+
**"Cannot find module '../services/ApiService'"**
|
|
574
|
+
```bash
|
|
575
|
+
# Make sure all dependencies are installed
|
|
576
|
+
npm install
|
|
577
|
+
```
|
|
751
578
|
|
|
752
|
-
|
|
579
|
+
**"Job execute function: ReferenceError: input is not defined"**
|
|
580
|
+
```typescript
|
|
581
|
+
// ❌ Wrong: Accessing parent scope
|
|
582
|
+
execute: async (job) => {
|
|
583
|
+
const message = input.message; // Error!
|
|
584
|
+
}
|
|
753
585
|
|
|
754
|
-
|
|
586
|
+
// ✅ Correct: Use metadata
|
|
587
|
+
metadata: { message: input.message },
|
|
588
|
+
execute: async (job) => {
|
|
589
|
+
const message = job.metadata.message; // Works!
|
|
590
|
+
}
|
|
591
|
+
```
|
|
755
592
|
|
|
593
|
+
**"Version not found when deploying"**
|
|
756
594
|
```bash
|
|
757
|
-
|
|
595
|
+
# Server needs time to process. Wait 10 seconds, then:
|
|
596
|
+
lua deploy
|
|
758
597
|
```
|
|
759
598
|
|
|
760
|
-
**Why?**
|
|
761
|
-
- Instant feedback
|
|
762
|
-
- Chat testing
|
|
763
|
-
- Live reload
|
|
764
|
-
- See what the AI actually does
|
|
765
|
-
|
|
766
599
|
---
|
|
767
600
|
|
|
768
|
-
|
|
601
|
+
## 📈 Scaling Your Agent
|
|
769
602
|
|
|
770
|
-
|
|
771
|
-
```typescript
|
|
772
|
-
// When creating
|
|
773
|
-
await Data.create('items', data, searchableText);
|
|
603
|
+
### Add More Skills
|
|
774
604
|
|
|
775
|
-
|
|
776
|
-
const results = await Data.search('items', query, 10, 0.7);
|
|
777
|
-
```
|
|
605
|
+
As your agent grows, organize tools into skills:
|
|
778
606
|
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
607
|
+
```typescript
|
|
608
|
+
// src/skills/analytics.skill.ts
|
|
609
|
+
export const analyticsSkill = new LuaSkill({
|
|
610
|
+
name: 'analytics-skill',
|
|
611
|
+
description: 'Data analytics and reporting',
|
|
612
|
+
context: 'Use these tools for data analysis',
|
|
613
|
+
tools: [
|
|
614
|
+
new GenerateReportTool(),
|
|
615
|
+
new ExportDataTool(),
|
|
616
|
+
new VisualizeTool()
|
|
617
|
+
]
|
|
618
|
+
});
|
|
619
|
+
```
|
|
786
620
|
|
|
787
|
-
###
|
|
621
|
+
### Add Background Processing
|
|
788
622
|
|
|
789
|
-
|
|
623
|
+
Use jobs for heavy or scheduled work:
|
|
790
624
|
|
|
791
|
-
**✅ Good:**
|
|
792
625
|
```typescript
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
626
|
+
// Instead of making users wait
|
|
627
|
+
// Create a job that processes in background
|
|
628
|
+
const job = await Jobs.create({
|
|
629
|
+
name: 'process-large-file',
|
|
630
|
+
metadata: { fileId: input.fileId },
|
|
631
|
+
schedule: { type: "once", executeAt: new Date() },
|
|
632
|
+
execute: async (job) => {
|
|
633
|
+
// Process file
|
|
634
|
+
// Notify user when done
|
|
635
|
+
}
|
|
636
|
+
});
|
|
804
637
|
```
|
|
805
638
|
|
|
806
|
-
|
|
639
|
+
### Add External Integrations
|
|
640
|
+
|
|
641
|
+
Use webhooks to receive events:
|
|
642
|
+
|
|
807
643
|
```typescript
|
|
808
|
-
|
|
644
|
+
// Receive events from Stripe, Shopify, etc.
|
|
645
|
+
export default new LuaWebhook({
|
|
646
|
+
name: "shopify-order",
|
|
647
|
+
execute: async ({ body }) => {
|
|
648
|
+
// Process Shopify order
|
|
649
|
+
// Update your system
|
|
650
|
+
// Notify customer
|
|
651
|
+
}
|
|
652
|
+
});
|
|
809
653
|
```
|
|
810
654
|
|
|
811
655
|
---
|
|
812
656
|
|
|
813
|
-
|
|
657
|
+
## 🔧 Advanced Configuration
|
|
814
658
|
|
|
815
|
-
|
|
659
|
+
### Multiple Environments
|
|
816
660
|
|
|
817
661
|
```bash
|
|
818
|
-
|
|
662
|
+
# Sandbox (testing)
|
|
663
|
+
lua chat # Select Sandbox
|
|
664
|
+
lua env sandbox
|
|
665
|
+
|
|
666
|
+
# Production (live users)
|
|
667
|
+
lua chat # Select Production
|
|
668
|
+
lua env production
|
|
819
669
|
```
|
|
820
670
|
|
|
821
|
-
|
|
822
|
-
- ✅ "What's the weather?" (missing city - should prompt)
|
|
823
|
-
- ✅ "Add laptop to cart" (need basket ID - should create)
|
|
824
|
-
- ✅ "XYZ" (nonsense - should handle gracefully)
|
|
671
|
+
### Skill Overrides
|
|
825
672
|
|
|
826
|
-
|
|
673
|
+
Test specific skill versions without deploying:
|
|
827
674
|
|
|
828
|
-
|
|
675
|
+
```typescript
|
|
676
|
+
// In sandbox mode, test development versions
|
|
677
|
+
// Production uses deployed versions
|
|
678
|
+
```
|
|
679
|
+
|
|
680
|
+
### Processor Chains
|
|
829
681
|
|
|
830
|
-
|
|
682
|
+
Process messages in order:
|
|
831
683
|
|
|
832
684
|
```typescript
|
|
833
|
-
|
|
834
|
-
|
|
685
|
+
preProcessors: [
|
|
686
|
+
profanityFilter, // 1. Clean input
|
|
687
|
+
intentClassifier, // 2. Detect intent
|
|
688
|
+
messageRouter // 3. Route to handler
|
|
689
|
+
]
|
|
835
690
|
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
Create `.env`:
|
|
842
|
-
```bash
|
|
843
|
-
STRIPE_API_KEY=your_key_here
|
|
691
|
+
postProcessors: [
|
|
692
|
+
responseFormatter, // 1. Format output
|
|
693
|
+
addDisclaimer, // 2. Add legal text
|
|
694
|
+
translateResponse // 3. Translate if needed
|
|
695
|
+
]
|
|
844
696
|
```
|
|
845
697
|
|
|
846
698
|
---
|
|
847
699
|
|
|
848
|
-
##
|
|
700
|
+
## 📊 Monitoring & Management
|
|
849
701
|
|
|
850
|
-
###
|
|
702
|
+
### View Production Status
|
|
851
703
|
|
|
852
|
-
```
|
|
853
|
-
|
|
854
|
-
import { LuaSkill } from "lua-cli";
|
|
855
|
-
import GetWeatherTool from "./tools/GetWeatherTool";
|
|
856
|
-
|
|
857
|
-
const weatherSkill = new LuaSkill({
|
|
858
|
-
name: "weather-skill",
|
|
859
|
-
version: "1.0.0",
|
|
860
|
-
description: "Provides weather information worldwide",
|
|
861
|
-
context: "Use get_weather when users ask about weather or temperature. Always include the city name.",
|
|
862
|
-
tools: [new GetWeatherTool()]
|
|
863
|
-
});
|
|
704
|
+
```bash
|
|
705
|
+
lua production
|
|
864
706
|
```
|
|
865
707
|
|
|
866
|
-
|
|
708
|
+
Shows:
|
|
709
|
+
- Active skills and versions
|
|
710
|
+
- Webhook URLs
|
|
711
|
+
- Scheduled jobs
|
|
712
|
+
- Environment variables
|
|
713
|
+
|
|
714
|
+
### View Logs
|
|
715
|
+
|
|
867
716
|
```bash
|
|
868
|
-
lua
|
|
869
|
-
lua push # Upload
|
|
870
|
-
lua deploy # Go live
|
|
717
|
+
lua logs
|
|
871
718
|
```
|
|
872
719
|
|
|
873
|
-
|
|
720
|
+
See:
|
|
721
|
+
- Agent conversations
|
|
722
|
+
- Tool executions
|
|
723
|
+
- Errors and warnings
|
|
724
|
+
- Performance metrics
|
|
874
725
|
|
|
875
|
-
###
|
|
726
|
+
### Manage Skills
|
|
876
727
|
|
|
877
|
-
|
|
728
|
+
```bash
|
|
729
|
+
# List all skills
|
|
730
|
+
lua skills
|
|
878
731
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
3. Update descriptions to match your domain
|
|
882
|
-
4. Update skill context
|
|
732
|
+
# Push specific skill
|
|
733
|
+
lua push skill
|
|
883
734
|
|
|
884
|
-
|
|
735
|
+
# Deploy specific version
|
|
736
|
+
lua deploy
|
|
737
|
+
```
|
|
885
738
|
|
|
886
739
|
---
|
|
887
740
|
|
|
888
|
-
|
|
741
|
+
## 🌐 CI/CD Integration
|
|
889
742
|
|
|
890
|
-
|
|
743
|
+
### GitHub Actions Example
|
|
891
744
|
|
|
892
|
-
|
|
745
|
+
```yaml
|
|
746
|
+
# .github/workflows/deploy.yml
|
|
747
|
+
name: Deploy Lua Agent
|
|
748
|
+
|
|
749
|
+
on:
|
|
750
|
+
push:
|
|
751
|
+
branches: [main]
|
|
752
|
+
|
|
753
|
+
jobs:
|
|
754
|
+
deploy:
|
|
755
|
+
runs-on: ubuntu-latest
|
|
756
|
+
steps:
|
|
757
|
+
- uses: actions/checkout@v3
|
|
758
|
+
|
|
759
|
+
- name: Setup Node.js
|
|
760
|
+
uses: actions/setup-node@v3
|
|
761
|
+
with:
|
|
762
|
+
node-version: '20'
|
|
763
|
+
|
|
764
|
+
- name: Install dependencies
|
|
765
|
+
run: npm install
|
|
766
|
+
|
|
767
|
+
- name: Install Lua CLI
|
|
768
|
+
run: npm install -g lua-cli@alpha
|
|
769
|
+
|
|
770
|
+
- name: Deploy to production
|
|
771
|
+
run: lua push all --force --auto-deploy
|
|
772
|
+
env:
|
|
773
|
+
LUA_API_KEY: ${{ secrets.LUA_API_KEY }}
|
|
774
|
+
```
|
|
775
|
+
|
|
776
|
+
### GitLab CI Example
|
|
893
777
|
|
|
894
|
-
|
|
778
|
+
```yaml
|
|
779
|
+
# .gitlab-ci.yml
|
|
780
|
+
deploy:
|
|
781
|
+
stage: deploy
|
|
782
|
+
image: node:20
|
|
783
|
+
script:
|
|
784
|
+
- npm install
|
|
785
|
+
- npm install -g lua-cli@alpha
|
|
786
|
+
- lua push all --force --auto-deploy
|
|
787
|
+
only:
|
|
788
|
+
- main
|
|
789
|
+
variables:
|
|
790
|
+
LUA_API_KEY: $LUA_API_KEY
|
|
791
|
+
```
|
|
895
792
|
|
|
896
793
|
---
|
|
897
794
|
|
|
898
|
-
##
|
|
795
|
+
## 🤝 Contributing
|
|
899
796
|
|
|
900
|
-
|
|
797
|
+
### Adding Examples
|
|
901
798
|
|
|
902
|
-
|
|
903
|
-
- Different domains (products vs orders)
|
|
904
|
-
- Different deployment schedules
|
|
905
|
-
- Logical organization
|
|
906
|
-
- Easier to manage
|
|
799
|
+
Have a great tool example? Add it to the template:
|
|
907
800
|
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
- AI chooses right skill automatically
|
|
801
|
+
1. Create the tool in `src/skills/tools/`
|
|
802
|
+
2. Add it to a skill
|
|
803
|
+
3. Test thoroughly
|
|
804
|
+
4. Document the use case
|
|
913
805
|
|
|
914
|
-
|
|
915
|
-
- Keep all 7 (if relevant)
|
|
916
|
-
- Merge into 1 (simpler)
|
|
917
|
-
- Create your own grouping
|
|
806
|
+
### Reporting Issues
|
|
918
807
|
|
|
919
|
-
|
|
808
|
+
Found a bug or have a suggestion?
|
|
920
809
|
|
|
921
|
-
|
|
810
|
+
- GitHub Issues: https://github.com/heylua/lua-cli/issues
|
|
811
|
+
- Email: support@heylua.ai
|
|
922
812
|
|
|
923
|
-
|
|
813
|
+
---
|
|
924
814
|
|
|
925
|
-
|
|
926
|
-
|----------|-------|----------|
|
|
927
|
-
| **Weather** | 1 | get_weather |
|
|
928
|
-
| **User Data** | 2 | get_user_data, update_user_data |
|
|
929
|
-
| **Products** | 6 | search, create, update, get, delete, get_by_id |
|
|
930
|
-
| **Baskets** | 9 | create, add_item, remove, clear, checkout, etc. |
|
|
931
|
-
| **Orders** | 4 | create, update_status, get, get_by_id |
|
|
932
|
-
| **Custom Data** | 6 | create, search, update, delete (movies example) |
|
|
933
|
-
| **Payment** | 1 | create_payment_link |
|
|
934
|
-
| **Posts** | 1 | create_post |
|
|
815
|
+
## 📝 Important Notes
|
|
935
816
|
|
|
936
|
-
|
|
817
|
+
### About Jobs and Closures
|
|
937
818
|
|
|
938
|
-
|
|
819
|
+
⚠️ **Job execute functions must be self-contained**
|
|
939
820
|
|
|
940
|
-
## 🚨 Common Mistakes to Avoid
|
|
941
|
-
|
|
942
|
-
### ❌ Mistake 1: Hardcoding API Keys
|
|
943
821
|
```typescript
|
|
944
|
-
|
|
945
|
-
|
|
822
|
+
// ❌ This will NOT work:
|
|
823
|
+
async execute(input: any) {
|
|
824
|
+
const userMessage = input.message;
|
|
825
|
+
|
|
826
|
+
await Jobs.create({
|
|
827
|
+
execute: async (job) => {
|
|
828
|
+
// userMessage is undefined here!
|
|
829
|
+
await user.send(userMessage);
|
|
830
|
+
}
|
|
831
|
+
});
|
|
832
|
+
}
|
|
946
833
|
|
|
947
|
-
✅
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
834
|
+
// ✅ This WILL work:
|
|
835
|
+
async execute(input: any) {
|
|
836
|
+
await Jobs.create({
|
|
837
|
+
metadata: { message: input.message }, // Pass via metadata
|
|
838
|
+
execute: async (job) => {
|
|
839
|
+
// Access from metadata
|
|
840
|
+
await job.user().send(job.metadata.message);
|
|
841
|
+
}
|
|
842
|
+
});
|
|
843
|
+
}
|
|
951
844
|
```
|
|
952
845
|
|
|
953
|
-
|
|
846
|
+
**Why?** Jobs are serialized and executed in a sandbox. They can't access parent scope variables.
|
|
954
847
|
|
|
955
|
-
###
|
|
956
|
-
```typescript
|
|
957
|
-
name = "tool1" // Unclear
|
|
958
|
-
name = "do_stuff" // Too generic
|
|
959
|
-
```
|
|
848
|
+
### About Bundling
|
|
960
849
|
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
850
|
+
The CLI automatically:
|
|
851
|
+
- ✅ Bundles all tool code and dependencies
|
|
852
|
+
- ✅ Excludes lua-cli APIs (available in sandbox)
|
|
853
|
+
- ✅ Compresses code for transmission
|
|
854
|
+
- ✅ Handles imports and dependencies
|
|
855
|
+
|
|
856
|
+
You don't need to worry about bundling - it just works!
|
|
967
857
|
|
|
968
858
|
---
|
|
969
859
|
|
|
970
|
-
|
|
971
|
-
```typescript
|
|
972
|
-
description = "Gets data" // Too vague
|
|
973
|
-
```
|
|
860
|
+
## 🎯 What's Next?
|
|
974
861
|
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
862
|
+
### Immediate Actions
|
|
863
|
+
1. ✅ Test the example tools: `lua test`
|
|
864
|
+
2. ✅ Chat with your agent: `lua chat` (select Sandbox)
|
|
865
|
+
3. ✅ Read the [Quick Start Guide](QUICKSTART.md)
|
|
866
|
+
4. ✅ Customize the agent persona in `src/index.ts`
|
|
979
867
|
|
|
980
|
-
|
|
868
|
+
### Short Term
|
|
869
|
+
1. ✅ Create your first custom tool
|
|
870
|
+
2. ✅ Deploy to production: `lua push`
|
|
871
|
+
3. ✅ Test in production: `lua chat` (select Production)
|
|
981
872
|
|
|
982
|
-
###
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
}
|
|
988
|
-
```
|
|
989
|
-
|
|
990
|
-
✅ **Fix:** Handle errors
|
|
991
|
-
```typescript
|
|
992
|
-
async execute(input: any) {
|
|
993
|
-
try {
|
|
994
|
-
const result = await api.call(input);
|
|
995
|
-
if (!result.success) {
|
|
996
|
-
throw new Error(result.error || 'API call failed');
|
|
997
|
-
}
|
|
998
|
-
return result.data;
|
|
999
|
-
} catch (error) {
|
|
1000
|
-
throw new Error(`Failed to fetch data: ${error.message}`);
|
|
1001
|
-
}
|
|
1002
|
-
}
|
|
1003
|
-
```
|
|
873
|
+
### Long Term
|
|
874
|
+
1. ✅ Add webhooks for external integrations
|
|
875
|
+
2. ✅ Schedule jobs for automated tasks
|
|
876
|
+
3. ✅ Build advanced tools with AI/external APIs
|
|
877
|
+
4. ✅ Monitor and improve based on user feedback
|
|
1004
878
|
|
|
1005
879
|
---
|
|
1006
880
|
|
|
1007
|
-
##
|
|
881
|
+
## 🌟 Example Projects
|
|
1008
882
|
|
|
1009
|
-
###
|
|
1010
|
-
-
|
|
1011
|
-
-
|
|
1012
|
-
-
|
|
1013
|
-
- ✅ Read the tool code
|
|
883
|
+
### Simple Assistant
|
|
884
|
+
- 3-5 basic tools
|
|
885
|
+
- No webhooks or jobs
|
|
886
|
+
- General Q&A and information retrieval
|
|
1014
887
|
|
|
1015
|
-
###
|
|
1016
|
-
-
|
|
1017
|
-
-
|
|
1018
|
-
-
|
|
1019
|
-
-
|
|
888
|
+
### E-commerce Bot
|
|
889
|
+
- Product catalog management
|
|
890
|
+
- Shopping cart tools
|
|
891
|
+
- Payment webhooks
|
|
892
|
+
- Abandoned cart jobs
|
|
1020
893
|
|
|
1021
|
-
###
|
|
1022
|
-
-
|
|
1023
|
-
-
|
|
1024
|
-
-
|
|
1025
|
-
-
|
|
894
|
+
### Support Agent
|
|
895
|
+
- Knowledge base search
|
|
896
|
+
- Ticket creation tools
|
|
897
|
+
- Escalation webhooks
|
|
898
|
+
- Daily summary jobs
|
|
899
|
+
|
|
900
|
+
### Data Platform
|
|
901
|
+
- Custom data tools
|
|
902
|
+
- Report generation
|
|
903
|
+
- Scheduled analytics jobs
|
|
904
|
+
- Webhook integrations
|
|
1026
905
|
|
|
1027
906
|
---
|
|
1028
907
|
|
|
1029
|
-
##
|
|
908
|
+
## 📞 Support & Resources
|
|
1030
909
|
|
|
1031
|
-
###
|
|
1032
|
-
-
|
|
1033
|
-
-
|
|
1034
|
-
-
|
|
910
|
+
### Get Help
|
|
911
|
+
- **Documentation:** https://docs.heylua.ai
|
|
912
|
+
- **CLI Reference:** Run `lua --help`
|
|
913
|
+
- **Email Support:** support@heylua.ai
|
|
914
|
+
- **Community:** https://community.heylua.ai
|
|
1035
915
|
|
|
1036
|
-
###
|
|
1037
|
-
|
|
1038
|
-
|
|
916
|
+
### Stay Updated
|
|
917
|
+
```bash
|
|
918
|
+
# Check your version
|
|
919
|
+
lua --version
|
|
1039
920
|
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
- Email: support@lua.ai
|
|
921
|
+
# Update to latest alpha
|
|
922
|
+
npm install -g lua-cli@alpha
|
|
923
|
+
```
|
|
1044
924
|
|
|
1045
925
|
---
|
|
1046
926
|
|
|
1047
|
-
##
|
|
927
|
+
## 📄 License
|
|
1048
928
|
|
|
1049
|
-
-
|
|
1050
|
-
- [ ] Updated skill names and descriptions
|
|
1051
|
-
- [ ] Wrote clear context for AI
|
|
1052
|
-
- [ ] Tested all tools with `lua test`
|
|
1053
|
-
- [ ] Tested conversationally with `lua dev`
|
|
1054
|
-
- [ ] No hardcoded secrets (use `.env`)
|
|
1055
|
-
- [ ] Updated version number
|
|
1056
|
-
- [ ] Reviewed error messages
|
|
1057
|
-
- [ ] Checked tool names (no spaces!)
|
|
929
|
+
This template is provided as part of lua-cli. See the main project license for details.
|
|
1058
930
|
|
|
1059
931
|
---
|
|
1060
932
|
|
|
1061
|
-
## 🎉
|
|
933
|
+
## 🎉 Happy Building!
|
|
934
|
+
|
|
935
|
+
You're all set to build amazing AI agents with Lua!
|
|
1062
936
|
|
|
1063
|
-
|
|
1064
|
-
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
937
|
+
**Remember:**
|
|
938
|
+
1. Start small - test one tool at a time
|
|
939
|
+
2. Use sandbox mode liberally
|
|
940
|
+
3. Read the example code - it's full of patterns
|
|
941
|
+
4. Deploy often - iterate quickly
|
|
1068
942
|
|
|
1069
|
-
**
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
943
|
+
**Need inspiration?** Check out the example tools in `src/skills/tools/` - they demonstrate:
|
|
944
|
+
- External API calls
|
|
945
|
+
- State management
|
|
946
|
+
- Error handling
|
|
947
|
+
- Complex business logic
|
|
948
|
+
- AI integrations
|
|
1074
949
|
|
|
1075
|
-
|
|
950
|
+
Build something awesome! 🚀
|
|
1076
951
|
|
|
1077
952
|
---
|
|
1078
953
|
|
|
1079
|
-
|
|
1080
|
-
- 📘 [Quick Start](QUICKSTART.md) - 5-minute guide
|
|
1081
|
-
- 🔧 [Tool Examples](TOOL_EXAMPLES.md) - Detailed tool docs
|
|
1082
|
-
- 💻 [CLI Commands](../CLI_REFERENCE.md) - Command reference
|
|
1083
|
-
- 📚 [API Docs](../API_REFERENCE.md) - Complete API reference
|
|
954
|
+
*Template version: 3.0.0 | Last updated: October 2025*
|
|
1084
955
|
|