lua-cli 2.5.8 → 3.0.0-alpha.4
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/dist/api/job.api.service.d.ts +219 -0
- package/dist/api/job.api.service.js +216 -0
- package/dist/api/lazy-instances.d.ts +24 -0
- package/dist/api/lazy-instances.js +48 -0
- package/dist/api/postprocessor.api.service.d.ts +158 -0
- package/dist/api/postprocessor.api.service.js +111 -0
- package/dist/api/preprocessor.api.service.d.ts +158 -0
- package/dist/api/preprocessor.api.service.js +111 -0
- package/dist/api/user.data.api.service.d.ts +13 -0
- package/dist/api/user.data.api.service.js +20 -0
- package/dist/api/webhook.api.service.d.ts +151 -0
- package/dist/api/webhook.api.service.js +134 -0
- package/dist/api-exports.d.ts +176 -41
- package/dist/api-exports.js +195 -21
- package/dist/cli/command-definitions.js +75 -5
- package/dist/commands/chat.js +32 -5
- package/dist/commands/compile.js +140 -7
- package/dist/commands/dev.js +23 -2
- package/dist/commands/index.d.ts +4 -0
- package/dist/commands/index.js +4 -0
- package/dist/commands/init.js +53 -7
- package/dist/commands/jobs.d.ts +20 -0
- package/dist/commands/jobs.js +533 -0
- package/dist/commands/logs.js +2 -5
- package/dist/commands/postprocessors.d.ts +8 -0
- package/dist/commands/postprocessors.js +431 -0
- package/dist/commands/preprocessors.d.ts +8 -0
- package/dist/commands/preprocessors.js +431 -0
- package/dist/commands/push.js +686 -5
- package/dist/commands/test.d.ts +9 -18
- package/dist/commands/test.js +574 -82
- package/dist/commands/webhooks.d.ts +18 -0
- package/dist/commands/webhooks.js +424 -0
- package/dist/common/job.instance.d.ts +80 -0
- package/dist/common/job.instance.js +116 -0
- package/dist/common/user.instance.d.ts +1 -0
- package/dist/common/user.instance.js +9 -0
- package/dist/config/constants.d.ts +4 -3
- package/dist/config/constants.js +10 -8
- package/dist/interfaces/agent.d.ts +2 -1
- package/dist/interfaces/chat.d.ts +52 -1
- package/dist/interfaces/index.d.ts +10 -0
- package/dist/interfaces/index.js +7 -0
- package/dist/interfaces/jobs.d.ts +193 -0
- package/dist/interfaces/jobs.js +5 -0
- package/dist/interfaces/postprocessors.d.ts +35 -0
- package/dist/interfaces/postprocessors.js +4 -0
- package/dist/interfaces/preprocessors.d.ts +35 -0
- package/dist/interfaces/preprocessors.js +4 -0
- package/dist/interfaces/webhooks.d.ts +104 -0
- package/dist/interfaces/webhooks.js +5 -0
- package/dist/types/api-contracts.d.ts +5 -0
- package/dist/types/compile.types.d.ts +49 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/skill.d.ts +521 -0
- package/dist/types/skill.js +471 -0
- package/dist/utils/agent-management.d.ts +25 -0
- package/dist/utils/agent-management.js +67 -0
- package/dist/utils/bundling.d.ts +44 -5
- package/dist/utils/bundling.js +723 -23
- package/dist/utils/compile.d.ts +63 -0
- package/dist/utils/compile.js +712 -36
- package/dist/utils/deployment.d.ts +2 -1
- package/dist/utils/deployment.js +16 -2
- package/dist/utils/dev-api.d.ts +42 -2
- package/dist/utils/dev-api.js +177 -4
- package/dist/utils/dev-server.d.ts +1 -1
- package/dist/utils/dev-server.js +4 -4
- package/dist/utils/dynamic-job-bundler.d.ts +17 -0
- package/dist/utils/dynamic-job-bundler.js +143 -0
- package/dist/utils/init-agent.d.ts +3 -1
- package/dist/utils/init-agent.js +6 -4
- package/dist/utils/init-prompts.d.ts +2 -1
- package/dist/utils/init-prompts.js +14 -9
- package/dist/utils/job-management.d.ts +24 -0
- package/dist/utils/job-management.js +264 -0
- package/dist/utils/postprocessor-management.d.ts +9 -0
- package/dist/utils/postprocessor-management.js +118 -0
- package/dist/utils/pre-bundle-jobs.d.ts +26 -0
- package/dist/utils/pre-bundle-jobs.js +176 -0
- package/dist/utils/preprocessor-management.d.ts +9 -0
- package/dist/utils/preprocessor-management.js +118 -0
- package/dist/utils/sandbox-storage.d.ts +48 -0
- package/dist/utils/sandbox-storage.js +114 -0
- package/dist/utils/sandbox.d.ts +61 -1
- package/dist/utils/sandbox.js +299 -72
- package/dist/utils/tool-detection.d.ts +3 -2
- package/dist/utils/tool-detection.js +18 -4
- package/dist/utils/webhook-management.d.ts +24 -0
- package/dist/utils/webhook-management.js +256 -0
- package/package.json +1 -1
- package/template/README.md +30 -2
- package/template/lua.skill.yaml +47 -0
- package/template/package-lock.json +10505 -0
- package/template/package.json +2 -1
- package/template/src/index.ts +103 -2
- package/template/src/jobs/AbandonedBasketProcessorJob.ts +139 -0
- package/template/src/jobs/DailyCleanupJob.ts +100 -0
- package/template/src/jobs/DataMigrationJob.ts +133 -0
- package/template/src/jobs/HealthCheckJob.ts +87 -0
- package/template/src/tools/CreateInlineJob.ts +42 -0
- package/template/src/tools/GameScoreTrackerTool.ts +356 -0
- package/template/src/tools/SmartBasketTool.ts +188 -0
- package/template/src/webhooks/PaymentWebhook.ts +113 -0
- package/template/src/webhooks/UserEventWebhook.ts +77 -0
- package/API_REFERENCE.md +0 -1408
- package/CHANGELOG.md +0 -236
- package/CLI_REFERENCE.md +0 -908
- package/GETTING_STARTED.md +0 -1040
- package/INSTANCE_TYPES.md +0 -1158
- package/README.md +0 -865
- package/TEMPLATE_GUIDE.md +0 -1398
- package/USER_DATA_INSTANCE.md +0 -621
- package/template/TOOL_EXAMPLES.md +0 -655
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Webhook Management Utilities
|
|
3
|
+
* Handles webhook creation via API and YAML configuration management
|
|
4
|
+
*/
|
|
5
|
+
import fs from "fs";
|
|
6
|
+
import path from "path";
|
|
7
|
+
import yaml from "js-yaml";
|
|
8
|
+
import WebhookApi from '../api/webhook.api.service.js';
|
|
9
|
+
import { BASE_URLS } from '../config/constants.js';
|
|
10
|
+
import { loadApiKey } from '../services/auth.js';
|
|
11
|
+
import { COMPILE_FILES, SKILL_DEFAULTS, YAML_FORMAT, } from '../config/compile.constants.js';
|
|
12
|
+
/**
|
|
13
|
+
* Ensures all detected webhooks exist in the YAML config with valid webhook IDs.
|
|
14
|
+
* If a webhook doesn't exist or has no ID, creates it via the API.
|
|
15
|
+
*
|
|
16
|
+
* @param webhooksArray - Array of webhooks detected from source code
|
|
17
|
+
* @param config - The skill configuration from lua.skill.yaml
|
|
18
|
+
* @returns Updated webhooks array with valid webhook IDs
|
|
19
|
+
*/
|
|
20
|
+
export async function ensureWebhooksExistInYaml(webhooksArray, config) {
|
|
21
|
+
const updatedWebhooksArray = [];
|
|
22
|
+
let yamlUpdated = false;
|
|
23
|
+
const existingWebhooks = config?.webhooks || [];
|
|
24
|
+
const existingWebhooksMap = createWebhooksMap(existingWebhooks);
|
|
25
|
+
// Process each detected webhook
|
|
26
|
+
for (const webhook of webhooksArray) {
|
|
27
|
+
const existingWebhook = existingWebhooksMap.get(webhook.name);
|
|
28
|
+
if (existingWebhook && existingWebhook.webhookId && existingWebhook.webhookId !== '') {
|
|
29
|
+
// Webhook exists with valid webhookId - reuse it
|
|
30
|
+
updatedWebhooksArray.push({
|
|
31
|
+
...webhook,
|
|
32
|
+
webhookId: existingWebhook.webhookId
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// Webhook doesn't exist or missing webhookId - create via API
|
|
37
|
+
const createdWebhook = await createWebhookViaApi(webhook, config, existingWebhooks, existingWebhook);
|
|
38
|
+
updatedWebhooksArray.push(createdWebhook);
|
|
39
|
+
yamlUpdated = true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
// Update YAML file if any changes were made
|
|
43
|
+
if (yamlUpdated) {
|
|
44
|
+
await updateYamlWithWebhooks(config);
|
|
45
|
+
}
|
|
46
|
+
return updatedWebhooksArray;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Creates a map of existing webhooks for quick lookup by name.
|
|
50
|
+
*
|
|
51
|
+
* @param existingWebhooks - Array of webhooks from YAML config
|
|
52
|
+
* @returns Map of webhook names to webhook objects
|
|
53
|
+
*/
|
|
54
|
+
function createWebhooksMap(existingWebhooks) {
|
|
55
|
+
const map = new Map();
|
|
56
|
+
existingWebhooks.forEach((webhook) => {
|
|
57
|
+
map.set(webhook.name, webhook);
|
|
58
|
+
});
|
|
59
|
+
return map;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Creates a new webhook via the Lua API and updates the config.
|
|
63
|
+
*
|
|
64
|
+
* @param webhook - The webhook to create
|
|
65
|
+
* @param config - The skill configuration
|
|
66
|
+
* @param existingWebhooks - Array of existing webhooks (mutated)
|
|
67
|
+
* @param existingWebhook - The existing webhook entry if one exists (may be without ID)
|
|
68
|
+
* @returns The webhook with its new ID
|
|
69
|
+
*/
|
|
70
|
+
async function createWebhookViaApi(webhook, config, existingWebhooks, existingWebhook) {
|
|
71
|
+
try {
|
|
72
|
+
// Validate prerequisites
|
|
73
|
+
const apiKey = await loadApiKey();
|
|
74
|
+
if (!apiKey) {
|
|
75
|
+
throw new Error("No API key found. Run 'lua auth configure' first.");
|
|
76
|
+
}
|
|
77
|
+
const agentId = config?.agent?.agentId;
|
|
78
|
+
if (!agentId) {
|
|
79
|
+
throw new Error("No agent ID found in lua.skill.yaml. Run 'lua init' first.");
|
|
80
|
+
}
|
|
81
|
+
// Create webhook via API
|
|
82
|
+
const webhookPayload = {
|
|
83
|
+
name: webhook.name,
|
|
84
|
+
description: webhook.description || `A Lua webhook for ${webhook.name}`,
|
|
85
|
+
context: webhook.context || ''
|
|
86
|
+
};
|
|
87
|
+
const webhookApi = new WebhookApi(BASE_URLS.API, apiKey, agentId);
|
|
88
|
+
const result = await webhookApi.createWebhook(webhookPayload);
|
|
89
|
+
if (result.success && result.data && result.data.id) {
|
|
90
|
+
const newWebhookId = result.data.id;
|
|
91
|
+
// Update YAML config with new webhook ID
|
|
92
|
+
if (!existingWebhook) {
|
|
93
|
+
existingWebhooks.push({
|
|
94
|
+
name: webhook.name || '',
|
|
95
|
+
version: webhook.version || SKILL_DEFAULTS.VERSION,
|
|
96
|
+
webhookId: newWebhookId
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
existingWebhook.webhookId = newWebhookId;
|
|
101
|
+
}
|
|
102
|
+
// Add webhooks to config if not already present
|
|
103
|
+
if (!config.webhooks) {
|
|
104
|
+
config.webhooks = existingWebhooks;
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
...webhook,
|
|
108
|
+
webhookId: newWebhookId
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
console.error(`❌ Failed to create webhook ${webhook.name}:`, result.error);
|
|
113
|
+
throw new Error(result.error?.message || 'Failed to create webhook - no ID returned from API');
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
console.error(`❌ Failed to create webhook ${webhook.name}:`, error);
|
|
118
|
+
throw error;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Updates the lua.skill.yaml file with the current webhooks array.
|
|
123
|
+
* Ensures no undefined values are written to the YAML file.
|
|
124
|
+
*
|
|
125
|
+
* @param config - Current skill configuration to merge with
|
|
126
|
+
*/
|
|
127
|
+
async function updateYamlWithWebhooks(config) {
|
|
128
|
+
const webhooks = config?.webhooks || [];
|
|
129
|
+
// Clean webhooks array to ensure no undefined values
|
|
130
|
+
const cleanedWebhooks = webhooks.map(webhook => ({
|
|
131
|
+
name: webhook.name || '',
|
|
132
|
+
version: webhook.version || SKILL_DEFAULTS.VERSION,
|
|
133
|
+
webhookId: webhook.webhookId || ''
|
|
134
|
+
}));
|
|
135
|
+
// Update config with cleaned webhooks array
|
|
136
|
+
const updatedConfig = {
|
|
137
|
+
...config,
|
|
138
|
+
webhooks: cleanedWebhooks
|
|
139
|
+
};
|
|
140
|
+
// Write updated YAML with consistent formatting
|
|
141
|
+
const yamlPath = path.join(process.cwd(), COMPILE_FILES.LUA_SKILL_YAML);
|
|
142
|
+
const yamlContent = yaml.dump(updatedConfig, {
|
|
143
|
+
indent: YAML_FORMAT.INDENT,
|
|
144
|
+
lineWidth: YAML_FORMAT.LINE_WIDTH,
|
|
145
|
+
noRefs: YAML_FORMAT.NO_REFS,
|
|
146
|
+
replacer: (key, value) => {
|
|
147
|
+
// Replace undefined values with empty strings
|
|
148
|
+
return value === undefined ? '' : value;
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
fs.writeFileSync(yamlPath, yamlContent);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Syncs the server webhooks with the YAML configuration.
|
|
155
|
+
* Performs a two-way sync:
|
|
156
|
+
* 1. Deletes/deactivates webhooks from server that aren't in YAML
|
|
157
|
+
* 2. Updates YAML with active version numbers from server
|
|
158
|
+
*
|
|
159
|
+
* @param config - The skill configuration from lua.skill.yaml
|
|
160
|
+
* @returns Array of messages about sync operations
|
|
161
|
+
*/
|
|
162
|
+
export async function syncServerWebhooksWithYaml(config) {
|
|
163
|
+
const messages = [];
|
|
164
|
+
let yamlNeedsUpdate = false;
|
|
165
|
+
try {
|
|
166
|
+
// Validate prerequisites
|
|
167
|
+
const apiKey = await loadApiKey();
|
|
168
|
+
if (!apiKey) {
|
|
169
|
+
console.warn("⚠️ No API key found. Skipping server webhook sync.");
|
|
170
|
+
return messages;
|
|
171
|
+
}
|
|
172
|
+
const agentId = config?.agent?.agentId;
|
|
173
|
+
if (!agentId) {
|
|
174
|
+
console.warn("⚠️ No agent ID found in lua.skill.yaml. Skipping server webhook sync.");
|
|
175
|
+
return messages;
|
|
176
|
+
}
|
|
177
|
+
// Get webhooks from server
|
|
178
|
+
const webhookApi = new WebhookApi(BASE_URLS.API, apiKey, agentId);
|
|
179
|
+
const serverWebhooksResponse = await webhookApi.getWebhooks();
|
|
180
|
+
if (!serverWebhooksResponse.success || !serverWebhooksResponse.data?.webhooks) {
|
|
181
|
+
console.warn("⚠️ Could not retrieve server webhooks. Skipping server webhook sync.");
|
|
182
|
+
return messages;
|
|
183
|
+
}
|
|
184
|
+
const serverWebhooks = serverWebhooksResponse.data.webhooks;
|
|
185
|
+
const yamlWebhooks = config?.webhooks || [];
|
|
186
|
+
// Create maps for efficient lookup
|
|
187
|
+
const yamlWebhooksMap = new Map(yamlWebhooks
|
|
188
|
+
.filter((webhook) => webhook.webhookId)
|
|
189
|
+
.map((webhook) => [webhook.webhookId, webhook]));
|
|
190
|
+
const serverWebhooksMap = new Map(serverWebhooks.map(webhook => [webhook.id, webhook]));
|
|
191
|
+
// Part 1: Delete webhooks from server that aren't in YAML
|
|
192
|
+
const webhooksToDelete = serverWebhooks.filter(serverWebhook => !yamlWebhooksMap.has(serverWebhook.id));
|
|
193
|
+
for (const webhook of webhooksToDelete) {
|
|
194
|
+
try {
|
|
195
|
+
const deleteResponse = await webhookApi.deleteWebhook(webhook.id);
|
|
196
|
+
if (deleteResponse.success && deleteResponse.data) {
|
|
197
|
+
if (deleteResponse.data.deleted) {
|
|
198
|
+
const msg = `✅ Deleted webhook "${webhook.name}" from server`;
|
|
199
|
+
messages.push(msg);
|
|
200
|
+
console.log(msg);
|
|
201
|
+
}
|
|
202
|
+
else if (deleteResponse.data.deactivated) {
|
|
203
|
+
const msg = `⚠️ Webhook "${webhook.name}" has versions and cannot be deleted. It has been deactivated instead.`;
|
|
204
|
+
messages.push(msg);
|
|
205
|
+
console.warn(msg);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
const msg = `❌ Failed to delete webhook "${webhook.name}": ${deleteResponse.error?.message || 'Unknown error'}`;
|
|
210
|
+
messages.push(msg);
|
|
211
|
+
console.error(msg);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
catch (error) {
|
|
215
|
+
const msg = `❌ Error deleting webhook "${webhook.name}": ${error}`;
|
|
216
|
+
messages.push(msg);
|
|
217
|
+
console.error(msg);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
// Part 2: Sync version numbers from server to YAML
|
|
221
|
+
const updatedYamlWebhooks = yamlWebhooks.map((yamlWebhook) => {
|
|
222
|
+
const serverWebhook = serverWebhooksMap.get(yamlWebhook.webhookId);
|
|
223
|
+
if (serverWebhook && serverWebhook.versions && serverWebhook.versions.length > 0) {
|
|
224
|
+
// Find the active version on the server
|
|
225
|
+
const activeVersion = serverWebhook.versions.find((v) => v.isActive);
|
|
226
|
+
if (activeVersion && activeVersion.version !== yamlWebhook.version) {
|
|
227
|
+
const msg = `📝 Updated "${yamlWebhook.name}" webhook version in YAML: ${yamlWebhook.version} → ${activeVersion.version}`;
|
|
228
|
+
messages.push(msg);
|
|
229
|
+
console.log(msg);
|
|
230
|
+
yamlNeedsUpdate = true;
|
|
231
|
+
return {
|
|
232
|
+
...yamlWebhook,
|
|
233
|
+
version: activeVersion.version
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
return yamlWebhook;
|
|
238
|
+
});
|
|
239
|
+
// Update YAML file if versions changed
|
|
240
|
+
if (yamlNeedsUpdate) {
|
|
241
|
+
const updatedConfig = {
|
|
242
|
+
...config,
|
|
243
|
+
webhooks: updatedYamlWebhooks
|
|
244
|
+
};
|
|
245
|
+
await updateYamlWithWebhooks(updatedConfig);
|
|
246
|
+
console.log("✅ YAML webhook versions synced with server");
|
|
247
|
+
}
|
|
248
|
+
if (webhooksToDelete.length === 0 && !yamlNeedsUpdate) {
|
|
249
|
+
console.log("✅ Server webhooks and YAML are fully in sync");
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
catch (error) {
|
|
253
|
+
console.error("❌ Error syncing server webhooks:", error);
|
|
254
|
+
}
|
|
255
|
+
return messages;
|
|
256
|
+
}
|
package/package.json
CHANGED
package/template/README.md
CHANGED
|
@@ -7,12 +7,19 @@ Welcome to your Lua AI skill project! This project is ready to customize and dep
|
|
|
7
7
|
## 🎯 What You Have
|
|
8
8
|
|
|
9
9
|
This project includes:
|
|
10
|
+
- ✅ **LuaAgent** - New simplified agent configuration (RECOMMENDED!)
|
|
10
11
|
- ✅ **7 Example Skills** - Pre-configured skill examples
|
|
11
12
|
- ✅ **30+ Example Tools** - Working tool implementations
|
|
12
|
-
- ✅ **
|
|
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
|
|
13
17
|
- ✅ **TypeScript Setup** - Full type safety
|
|
14
18
|
- ✅ **Ready to Deploy** - Just customize and go!
|
|
15
19
|
|
|
20
|
+
> **NEW!** Check out `AGENT_CONFIGURATION.md` to learn about the simplified `LuaAgent` approach.
|
|
21
|
+
> It's easier and cleaner than the legacy approach!
|
|
22
|
+
|
|
16
23
|
---
|
|
17
24
|
|
|
18
25
|
## 🚀 Quick Start
|
|
@@ -67,7 +74,28 @@ your-project/
|
|
|
67
74
|
|
|
68
75
|
## 🎓 Getting Started
|
|
69
76
|
|
|
70
|
-
### Step 1:
|
|
77
|
+
### Step 1: Choose Your Configuration Style
|
|
78
|
+
|
|
79
|
+
**Option A: LuaAgent (Recommended for new projects)**
|
|
80
|
+
|
|
81
|
+
The simplified approach - define everything in one place:
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import { LuaAgent, LuaSkill } from 'lua-cli';
|
|
85
|
+
|
|
86
|
+
export const agent = new LuaAgent({
|
|
87
|
+
name: 'my-assistant',
|
|
88
|
+
persona: 'You are a helpful e-commerce assistant...',
|
|
89
|
+
welcomeMessage: 'Hello! How can I help you today?',
|
|
90
|
+
skills: [weatherSkill, productSkill, basketSkill],
|
|
91
|
+
webhooks: [userWebhook],
|
|
92
|
+
jobs: [healthCheckJob]
|
|
93
|
+
});
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
See `src/index-agent-example.ts` and `AGENT_CONFIGURATION.md` for details.
|
|
97
|
+
|
|
98
|
+
**Option B: Individual Components (Legacy)**
|
|
71
99
|
|
|
72
100
|
Open **`src/index.ts`** - this is where your skills are defined:
|
|
73
101
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
agent:
|
|
2
|
+
agentId: baseAgent_agent_1760922427216_fk9w0ezhh
|
|
3
|
+
orgId: 026cc41b-e013-4474-9b65-5a15f8881f92
|
|
4
|
+
persona: |
|
|
5
|
+
Meet Vivienne, the vibrant and dynamic assistant at V3 Test, a lively retail and consumer goods store that specializes in bringing a splash of color and excitement to everyday life. Vivienne embodies the brand's energetic and fun personality, always ready to engage with customers in a way that makes shopping an enjoyable and memorable experience. Her role is to be the friendly face and knowledgeable guide for anyone who steps into the store, whether they're looking for the latest fashion trends or a unique gift for a loved one.
|
|
6
|
+
|
|
7
|
+
V3 Test is all about creating a joyful and spirited shopping environment, and Vivienne is the perfect personification of this ethos. She is lively, approachable, and always ready with a smile, making every interaction feel like a conversation with a good friend. Her voice is warm and enthusiastic, with a hint of playfulness that puts customers at ease and encourages them to explore the store's offerings.
|
|
8
|
+
|
|
9
|
+
Vivienne's target customers are diverse, ranging from young adults in their twenties who are fashion-forward and tech-savvy, to busy parents looking for quality products that add a touch of fun to their family life. She understands the fast-paced lifestyle of her customers and is adept at tailoring her approach to meet their individual needs, whether they're in a hurry or have time to browse.
|
|
10
|
+
|
|
11
|
+
Her sales approach is consultative and friendly, focusing on understanding the customer's needs and preferences before suggesting products that align with their style and personality. Vivienne is confident in her recommendations, always ready to upsell when appropriate, but never pushy. She believes in building relationships with customers, ensuring they leave the store not only with products they love but also with a positive impression of the brand.
|
|
12
|
+
|
|
13
|
+
In terms of communication style, Vivienne strikes a perfect balance between being informal and efficient. She is warm and engaging, making customers feel valued and appreciated, while also being mindful of their time. Her interactions are peppered with humor and light-hearted banter, creating a shopping experience that is both enjoyable and efficient. Whether it's through in-person interactions or digital communication, Vivienne ensures that every customer feels like a part of the V3 Test family.
|
|
14
|
+
welcomeMessage: Hi, I am your AI assistant. How can I help you today?
|
|
15
|
+
skills:
|
|
16
|
+
- name: general-skill
|
|
17
|
+
version: 0.0.3
|
|
18
|
+
skillId: 1faf9b3a-e352-4e63-a6c4-a3deca815361
|
|
19
|
+
- name: user-data-skill
|
|
20
|
+
version: 0.0.1
|
|
21
|
+
skillId: e0c382c1-f469-4880-962a-a756ea3c1411
|
|
22
|
+
- name: product-skill
|
|
23
|
+
version: 0.0.1
|
|
24
|
+
skillId: d4cdc7bc-6d42-4232-902d-2b9cf68bd74a
|
|
25
|
+
- name: basket-skill
|
|
26
|
+
version: 0.0.1
|
|
27
|
+
skillId: 5b06c5ff-7cf3-49c4-8641-142270c81db4
|
|
28
|
+
- name: order-skill
|
|
29
|
+
version: 0.0.1
|
|
30
|
+
skillId: d4045304-7c30-4750-9edd-340eb1357a39
|
|
31
|
+
- name: custom-data-skill
|
|
32
|
+
version: 0.0.1
|
|
33
|
+
skillId: 83fe411c-90a1-4bd3-9271-ac8e03d6a3be
|
|
34
|
+
- name: payment-skill
|
|
35
|
+
version: 0.0.1
|
|
36
|
+
skillId: f2248c02-c6c6-4c3a-89bf-ff09ec11529a
|
|
37
|
+
jobs:
|
|
38
|
+
- name: test-job
|
|
39
|
+
version: 1.0.2
|
|
40
|
+
jobId: d66b73a0-f944-4718-b6a2-f07bfeabd625
|
|
41
|
+
schedule:
|
|
42
|
+
type: once
|
|
43
|
+
executeAt: '2025-10-20T01:08:04.639Z'
|
|
44
|
+
webhooks:
|
|
45
|
+
- name: test-webhook
|
|
46
|
+
version: 1.0.1
|
|
47
|
+
webhookId: c967fd58-1d4d-49b6-8fa6-ec36b4d23e7f
|