lua-cli 1.3.2-alpha.3 → 2.0.0

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.
@@ -1,7 +1,8 @@
1
1
  import inquirer from "inquirer";
2
2
  import { fileURLToPath } from "url";
3
3
  import path from "path";
4
- import { loadApiKey, checkApiKey, createSkill, getAgentTypes, createAgent, getAgentDetails } from "../services/auth.js";
4
+ import { loadApiKey, checkApiKey } from "../services/auth.js";
5
+ import { ApiService } from "../services/api.js";
5
6
  import { copyTemplateFiles, createSkillYaml } from "../utils/files.js";
6
7
  import { withErrorHandling, clearPromptLines, writeProgress, writeSuccess } from "../utils/cli.js";
7
8
  function getTemplateDir() {
@@ -13,7 +14,7 @@ export async function initCommand() {
13
14
  return withErrorHandling(async () => {
14
15
  const apiKey = await loadApiKey();
15
16
  if (!apiKey) {
16
- console.error("❌ No API key found. Run `lua configure` first.");
17
+ console.error("❌ No API key found. Run `lua auth configure` first.");
17
18
  process.exit(1);
18
19
  }
19
20
  // Ask user if they want to create a new agent or select existing one
@@ -29,7 +30,7 @@ export async function initCommand() {
29
30
  }
30
31
  ]);
31
32
  // Clear the agent choice prompt lines
32
- clearPromptLines(2);
33
+ // clearPromptLines(2);
33
34
  let selectedAgent;
34
35
  let selectedOrg;
35
36
  let persona;
@@ -59,7 +60,7 @@ export async function initCommand() {
59
60
  ]);
60
61
  selectedOrg = existingOrg;
61
62
  // Clear the organization selection prompt lines
62
- clearPromptLines(2);
63
+ // clearPromptLines(2);
63
64
  // Extract agents from selected organization
64
65
  if (!selectedOrg.agents || selectedOrg.agents.length === 0) {
65
66
  console.error("❌ No agents found in the selected organization.");
@@ -80,28 +81,27 @@ export async function initCommand() {
80
81
  ]);
81
82
  selectedAgent = existingAgent;
82
83
  // Clear the agent selection prompt lines
83
- clearPromptLines(2);
84
+ // clearPromptLines(2);
84
85
  }
85
86
  else {
86
- // Create new agent flow
87
+ // Create new agent flow - always use baseAgent
87
88
  writeProgress("🔄 Fetching agent types...");
88
- const agentTypes = await getAgentTypes(apiKey);
89
+ const agentTypesResult = await ApiService.Agent.getAgentTypes(apiKey);
90
+ const agentTypes = agentTypesResult.success ? agentTypesResult.data || [] : [];
89
91
  writeProgress("✅ Agent types loaded");
90
- // Select agent type
91
- const agentTypeChoices = agentTypes.map((type) => ({
92
- name: type.name,
93
- value: type
94
- }));
95
- const { selectedAgentType } = await inquirer.prompt([
96
- {
97
- type: "list",
98
- name: "selectedAgentType",
99
- message: "Select an agent type:",
100
- choices: agentTypeChoices
101
- }
102
- ]);
103
- // Clear the agent type selection prompt lines
104
- clearPromptLines(2);
92
+ // Always select Base Agent (skip user selection)
93
+ let selectedAgentType = agentTypes.find((type) => type.name === 'Base Agent' ||
94
+ type.name === 'baseAgent' ||
95
+ type.name.toLowerCase().includes('base'));
96
+ // If still not found, use the first available type
97
+ if (!selectedAgentType && agentTypes.length > 0) {
98
+ selectedAgentType = agentTypes[0];
99
+ writeProgress(`⚠️ baseAgent not found, using ${selectedAgentType.name} instead`);
100
+ }
101
+ if (!selectedAgentType) {
102
+ throw new Error("No agent types available. Please contact support.");
103
+ }
104
+ writeProgress(`✅ Using agent type: ${selectedAgentType.name}`);
105
105
  // Collect required metadata
106
106
  const metadata = {};
107
107
  if (selectedAgentType.requiredSubAgentMetadata && selectedAgentType.requiredSubAgentMetadata.length > 0) {
@@ -116,12 +116,13 @@ export async function initCommand() {
116
116
  ]);
117
117
  metadata[field] = value;
118
118
  // Clear the metadata prompt lines
119
- clearPromptLines(2);
119
+ // clearPromptLines(2);
120
120
  }
121
121
  }
122
122
  // Configure features
123
123
  const features = {};
124
124
  const availableFeatures = Object.keys(selectedAgentType.features);
125
+ let linesToClear = 1;
125
126
  if (availableFeatures.length > 0) {
126
127
  for (const feature of availableFeatures) {
127
128
  const { [feature]: enabled } = await inquirer.prompt([
@@ -133,8 +134,9 @@ export async function initCommand() {
133
134
  }
134
135
  ]);
135
136
  features[feature] = enabled;
137
+ linesToClear++;
136
138
  // Clear the feature prompt lines
137
- clearPromptLines(2);
139
+ // clearPromptLines(2);
138
140
  }
139
141
  }
140
142
  // Collect persona information
@@ -162,7 +164,8 @@ export async function initCommand() {
162
164
  default: "Private"
163
165
  }
164
166
  ]);
165
- clearPromptLines(2);
167
+ // clearPromptLines(2);
168
+ linesToClear++;
166
169
  const { agentName } = await inquirer.prompt([
167
170
  {
168
171
  type: "input",
@@ -171,7 +174,8 @@ export async function initCommand() {
171
174
  validate: (input) => input.trim().length > 0 || "Agent name is required"
172
175
  }
173
176
  ]);
174
- clearPromptLines(2);
177
+ // clearPromptLines(2);
178
+ linesToClear++;
175
179
  const { businessType } = await inquirer.prompt([
176
180
  {
177
181
  type: "list",
@@ -180,7 +184,8 @@ export async function initCommand() {
180
184
  choices: businessTypes
181
185
  }
182
186
  ]);
183
- clearPromptLines(2);
187
+ // clearPromptLines(2);
188
+ linesToClear++;
184
189
  const { brandPersonality } = await inquirer.prompt([
185
190
  {
186
191
  type: "list",
@@ -189,7 +194,8 @@ export async function initCommand() {
189
194
  choices: brandPersonalities
190
195
  }
191
196
  ]);
192
- clearPromptLines(2);
197
+ // clearPromptLines(2);
198
+ linesToClear++;
193
199
  const { brandTraits } = await inquirer.prompt([
194
200
  {
195
201
  type: "input",
@@ -198,10 +204,13 @@ export async function initCommand() {
198
204
  default: ""
199
205
  }
200
206
  ]);
201
- clearPromptLines(2);
207
+ // clearPromptLines(2);
208
+ linesToClear++;
202
209
  // For new agents, we need to handle organization selection
203
210
  // For now, we'll create a new organization with the business name
204
211
  // In the future, we could add organization selection here too
212
+ clearPromptLines(linesToClear);
213
+ linesToClear = 0;
205
214
  // Create agent
206
215
  writeProgress("🔄 Creating agent...");
207
216
  const agentData = {
@@ -220,7 +229,7 @@ export async function initCommand() {
220
229
  registeredName: businessName
221
230
  }
222
231
  };
223
- const createAgentResult = await createAgent(apiKey, agentData);
232
+ const createAgentResult = await ApiService.Agent.createAgent(apiKey, agentData);
224
233
  if (!createAgentResult.success || !createAgentResult.data) {
225
234
  console.error("❌ Failed to create agent:", createAgentResult.error?.message || "Unknown error");
226
235
  process.exit(1);
@@ -230,7 +239,7 @@ export async function initCommand() {
230
239
  writeProgress("⏳ Waiting for agent to be ready...");
231
240
  await new Promise(resolve => setTimeout(resolve, 30000));
232
241
  writeProgress("🔄 Fetching agent details...");
233
- const agentDetailsResult = await getAgentDetails(apiKey, createAgentResult.data.agentId);
242
+ const agentDetailsResult = await ApiService.Agent.getAgent(apiKey, createAgentResult.data?.agentId);
234
243
  if (!agentDetailsResult.success || !agentDetailsResult.data) {
235
244
  console.error("❌ Failed to fetch agent details:", agentDetailsResult.error?.message || "Unknown error");
236
245
  process.exit(1);
@@ -247,64 +256,19 @@ export async function initCommand() {
247
256
  };
248
257
  writeProgress("✅ Agent details loaded");
249
258
  }
250
- // Get skill name and handle retries
251
- let skillName = "";
252
- let skillData = null;
253
- let retry = true;
254
- while (retry) {
255
- const { skillName: inputSkillName } = await inquirer.prompt([
256
- {
257
- type: "input",
258
- name: "skillName",
259
- message: "Enter a name for your skill:",
260
- default: "My Lua Skill"
261
- }
262
- ]);
263
- skillName = inputSkillName;
264
- // Create skill via API
265
- writeProgress("🔄 Creating skill...");
266
- const result = await createSkill(apiKey, selectedAgent.agentId, skillName);
267
- if (result.success && result.data) {
268
- skillData = result.data;
269
- writeProgress("✅ Skill created successfully!");
270
- retry = false;
271
- }
272
- else if (result.error) {
273
- console.error(`❌ ${result.error.message}`);
274
- const { shouldRetry } = await inquirer.prompt([
275
- {
276
- type: "confirm",
277
- name: "shouldRetry",
278
- message: "Would you like to try with a different name?",
279
- default: true
280
- }
281
- ]);
282
- // Clear the retry prompt lines
283
- clearPromptLines(2);
284
- if (!shouldRetry) {
285
- writeProgress("❌ Skill creation cancelled.");
286
- process.exit(1);
287
- }
288
- }
289
- else {
290
- console.error("❌ Failed to create skill. Please try again.");
291
- process.exit(1);
292
- }
293
- }
294
- // Create lua.skill.yaml file with skill ID, actual skill name, persona and welcome message from backend
295
- const actualSkillName = skillData?.name || skillName;
259
+ // Skills will be created automatically during compilation
296
260
  // Copy template files
297
261
  const templateDir = getTemplateDir();
298
262
  const currentDir = process.cwd();
299
263
  copyTemplateFiles(templateDir, currentDir);
300
- createSkillYaml(selectedAgent.agentId, selectedOrg.id, actualSkillName, skillData?.id, persona, welcomeMessage);
264
+ createSkillYaml(selectedAgent.agentId, selectedOrg.id, undefined, undefined, persona, welcomeMessage);
301
265
  writeProgress("✅ Created lua.skill.yaml");
302
266
  writeProgress("✅ Copied template files");
303
267
  // Install dependencies
304
268
  writeProgress("📦 Installing dependencies...");
305
269
  const { execSync } = await import('child_process');
306
270
  try {
307
- execSync('npm install', { stdio: 'inherit', cwd: currentDir });
271
+ execSync('npm install --force', { stdio: 'inherit', cwd: currentDir });
308
272
  writeProgress("✅ Dependencies installed successfully");
309
273
  }
310
274
  catch (error) {
@@ -82,7 +82,7 @@ export async function pushCommand() {
82
82
  // Load API key
83
83
  const apiKey = await loadApiKey();
84
84
  if (!apiKey) {
85
- console.error("❌ No API key found. Please run 'lua configure' to set up your API key.");
85
+ console.error("❌ No API key found. Please run 'lua auth configure' to set up your API key.");
86
86
  process.exit(1);
87
87
  }
88
88
  // Validate API key
@@ -6,7 +6,7 @@ import { gunzipSync } from "zlib";
6
6
  import { Buffer } from "buffer";
7
7
  import { withErrorHandling, clearPromptLines, writeProgress, writeSuccess } from "../utils/cli.js";
8
8
  import { loadApiKey } from "../services/auth.js";
9
- import { executeTool } from "../utils/sandbox.js";
9
+ import { executeTool, loadEnvironmentVariables } from "../utils/sandbox.js";
10
10
  import { readSkillConfig } from "../utils/files.js";
11
11
  // Decompression utility
12
12
  function decompressCode(compressedCode) {
@@ -30,7 +30,35 @@ export async function testCommand() {
30
30
  throw new Error("deploy.json not found. Run 'lua compile' first.");
31
31
  }
32
32
  const deployData = JSON.parse(fs.readFileSync(deployJsonPath, "utf8"));
33
- if (!deployData.tools || deployData.tools.length === 0) {
33
+ // Extract all tools from deploy.json (handle both new and legacy formats)
34
+ let allTools = [];
35
+ if (deployData.skills && Array.isArray(deployData.skills)) {
36
+ // New format: extract tools from skills array
37
+ deployData.skills.forEach((skill) => {
38
+ if (skill.tools && Array.isArray(skill.tools)) {
39
+ skill.tools.forEach((tool) => {
40
+ allTools.push({
41
+ ...tool,
42
+ skillName: skill.name // Add skill context
43
+ });
44
+ });
45
+ }
46
+ });
47
+ }
48
+ else if (deployData.tools) {
49
+ // Legacy format: tools as object or array
50
+ if (Array.isArray(deployData.tools)) {
51
+ allTools = deployData.tools;
52
+ }
53
+ else {
54
+ // Convert tools object to array
55
+ allTools = Object.entries(deployData.tools).map(([name, tool]) => ({
56
+ name,
57
+ ...tool
58
+ }));
59
+ }
60
+ }
61
+ if (allTools.length === 0) {
34
62
  throw new Error("No tools found in deploy.json");
35
63
  }
36
64
  // Get API key from keystore and agent ID from YAML
@@ -42,18 +70,19 @@ export async function testCommand() {
42
70
  const config = readSkillConfig();
43
71
  const agentId = config?.agent?.agentId;
44
72
  if (!agentId) {
45
- throw new Error("No agent ID found in lua.skill.yaml. Please run 'lua skill init' first.");
73
+ throw new Error("No agent ID found in lua.skill.yaml. Please run 'lua init' first.");
46
74
  }
47
- // Extract environment variables from YAML config
48
- const envVars = {};
49
- if (config?.skill?.env) {
50
- for (const [key, value] of Object.entries(config.skill.env)) {
51
- envVars[key] = value;
52
- }
75
+ // Load environment variables from multiple sources (.env + yaml)
76
+ const envVars = loadEnvironmentVariables();
77
+ if (fs.existsSync(path.join(process.cwd(), '.env'))) {
78
+ writeProgress(`📄 Loaded environment variables from .env file`);
79
+ }
80
+ if (config?.skill?.env && Object.keys(config.skill.env).length > 0) {
81
+ writeProgress(`📄 Loaded environment variables from lua.skill.yaml`);
53
82
  }
54
83
  // Let user select a tool using picker
55
- const toolChoices = deployData.tools.map((tool) => ({
56
- name: `${tool.name} - ${tool.description}`,
84
+ const toolChoices = allTools.map((tool) => ({
85
+ name: tool.skillName ? `${tool.name} (${tool.skillName}) - ${tool.description}` : `${tool.name} - ${tool.description}`,
57
86
  value: tool
58
87
  }));
59
88
  const { selectedTool } = await inquirer.prompt([
@@ -190,6 +219,11 @@ export async function testCommand() {
190
219
  writeProgress(`Input: ${JSON.stringify(inputValues, null, 2)}`);
191
220
  // Get the execute function string directly from the selected tool and decompress it
192
221
  const toolCode = decompressCode(selectedTool.execute);
222
+ // Set environment variables in process.env for the sandbox to pick up
223
+ const originalEnv = { ...process.env };
224
+ for (const [key, value] of Object.entries(envVars)) {
225
+ process.env[key] = value;
226
+ }
193
227
  // Execute the tool
194
228
  try {
195
229
  const result = await executeTool({
@@ -208,5 +242,9 @@ export async function testCommand() {
208
242
  console.error(executionError.stack);
209
243
  }
210
244
  }
245
+ finally {
246
+ // Restore original environment variables
247
+ process.env = originalEnv;
248
+ }
211
249
  }, "testing");
212
250
  }
package/dist/index.js CHANGED
@@ -17,30 +17,28 @@ authCommand
17
17
  .command("key")
18
18
  .description("Display your stored API key")
19
19
  .action(apiKeyCommand);
20
- const skillCommand = program
21
- .command("skill")
22
- .description("Lua skill management commands");
23
- skillCommand
20
+ // Skill management commands (moved to top level)
21
+ program
24
22
  .command("init")
25
23
  .description("Initialize a new Lua skill project")
26
24
  .action(initCommand);
27
- skillCommand
25
+ program
28
26
  .command("compile")
29
27
  .description("Compile Lua skill to generate deployable format")
30
28
  .action(compileCommand);
31
- skillCommand
29
+ program
32
30
  .command("test")
33
31
  .description("Test Lua skill tools interactively")
34
32
  .action(testCommand);
35
- skillCommand
33
+ program
36
34
  .command("push")
37
35
  .description("Push compiled skill version to server")
38
36
  .action(pushCommand);
39
- skillCommand
37
+ program
40
38
  .command("deploy")
41
39
  .description("Deploy a version to production")
42
40
  .action(deployCommand);
43
- skillCommand
41
+ program
44
42
  .command("dev")
45
43
  .description("Push compiled skill version to sandbox for development")
46
44
  .action(devCommand);
@@ -151,8 +151,11 @@ export declare class AgentApi {
151
151
  */
152
152
  export declare class SkillApi {
153
153
  static createSkill(apiKey: string, agentId: string, skillData: any): Promise<ApiResponse<{
154
- skillId: string;
154
+ id: string;
155
155
  name: string;
156
+ description?: string;
157
+ agentId: string;
158
+ context?: string;
156
159
  }>>;
157
160
  static pushSkill(apiKey: string, agentId: string, skillId: string, versionData: any): Promise<ApiResponse<DevVersionResponse>>;
158
161
  static pushDevSkill(apiKey: string, agentId: string, skillId: string, versionData: any): Promise<ApiResponse<DevVersionResponse>>;
@@ -4,10 +4,10 @@
4
4
  */
5
5
  // Base URLs for different environments
6
6
  const BASE_URLS = {
7
- LOCAL: 'http://localhost:3022',
8
- API: 'https://api.lua.dev',
9
- AUTH: 'https://auth.lua.dev',
10
- CHAT: 'http://localhost:3001'
7
+ LOCAL: 'https://api.heylua.ai',
8
+ API: 'https://api.heylua.ai',
9
+ AUTH: 'https://auth.heylua.ai',
10
+ CHAT: 'https://api.heylua.ai'
11
11
  };
12
12
  /**
13
13
  * Generic HTTP client with common error handling
@@ -86,10 +86,10 @@ export class AuthApi {
86
86
  });
87
87
  }
88
88
  static async sendOtp(email) {
89
- return httpClient.post(`${BASE_URLS.AUTH}/otp`, { email });
89
+ return httpClient.post(`${BASE_URLS.AUTH}/otp`, { email, type: 'email' });
90
90
  }
91
91
  static async verifyOtp(email, otp) {
92
- return httpClient.post(`${BASE_URLS.AUTH}/otp/verify`, { email, otp });
92
+ return httpClient.post(`${BASE_URLS.AUTH}/otp/verify`, { email, pin: otp, type: 'email' });
93
93
  }
94
94
  static async getApiKey(signInToken) {
95
95
  return httpClient.post(`${BASE_URLS.AUTH}/profile/apiKey`, undefined, {
@@ -127,6 +127,7 @@ export class AgentApi {
127
127
  */
128
128
  export class SkillApi {
129
129
  static async createSkill(apiKey, agentId, skillData) {
130
+ // console.log(`Skill data:`, skillData);
130
131
  return httpClient.post(`${BASE_URLS.LOCAL}/developer/skills/${agentId}`, skillData, {
131
132
  Authorization: `Bearer ${apiKey}`,
132
133
  });
@@ -25,7 +25,6 @@ export interface CreateSkillResponse {
25
25
  statusCode: number;
26
26
  };
27
27
  }
28
- export declare function createSkill(apiKey: string, agentId: string, skillName: string): Promise<CreateSkillResponse>;
29
28
  export interface AgentType {
30
29
  id: string;
31
30
  name: string;
@@ -105,6 +104,3 @@ export interface AgentDetailsResponse {
105
104
  statusCode: number;
106
105
  };
107
106
  }
108
- export declare function getAgentTypes(apiKey: string): Promise<AgentType[]>;
109
- export declare function createAgent(apiKey: string, agentData: CreateAgentRequest): Promise<CreateAgentResponse>;
110
- export declare function getAgentDetails(apiKey: string, agentId: string): Promise<AgentDetailsResponse>;
@@ -49,132 +49,5 @@ export async function generateApiKey(signInToken) {
49
49
  return null;
50
50
  }
51
51
  }
52
- export async function createSkill(apiKey, agentId, skillName) {
53
- try {
54
- const response = await fetch(`http://localhost:3022/developer/skills/${agentId}`, {
55
- method: "POST",
56
- headers: {
57
- "accept": "application/json",
58
- "Authorization": `Bearer ${apiKey}`,
59
- "Content-Type": "application/json"
60
- },
61
- body: JSON.stringify({
62
- name: skillName
63
- })
64
- });
65
- const data = await response.json();
66
- if (response.ok) {
67
- return {
68
- success: true,
69
- data: data
70
- };
71
- }
72
- else {
73
- return {
74
- success: false,
75
- error: data
76
- };
77
- }
78
- }
79
- catch (error) {
80
- console.error("❌ Error creating skill:", error);
81
- return {
82
- success: false,
83
- error: {
84
- message: "Network error",
85
- error: "Failed to connect to server",
86
- statusCode: 500
87
- }
88
- };
89
- }
90
- }
91
- export async function getAgentTypes(apiKey) {
92
- try {
93
- const response = await fetch('https://api.lua.dev/agents/self-serve/types', {
94
- method: 'GET',
95
- headers: {
96
- 'Authorization': `Bearer ${apiKey}`,
97
- 'Content-Type': 'application/json'
98
- }
99
- });
100
- if (!response.ok) {
101
- throw new Error(`HTTP error! status: ${response.status}`);
102
- }
103
- return await response.json();
104
- }
105
- catch (error) {
106
- console.error('❌ Error fetching agent types:', error);
107
- throw error;
108
- }
109
- }
110
- export async function createAgent(apiKey, agentData) {
111
- try {
112
- const response = await fetch('https://api.lua.dev/agents/self-serve/create', {
113
- method: 'POST',
114
- headers: {
115
- 'Authorization': `Bearer ${apiKey}`,
116
- 'Content-Type': 'application/json'
117
- },
118
- body: JSON.stringify(agentData)
119
- });
120
- const data = await response.json();
121
- if (response.ok) {
122
- return {
123
- success: true,
124
- data: data
125
- };
126
- }
127
- else {
128
- return {
129
- success: false,
130
- error: data
131
- };
132
- }
133
- }
134
- catch (error) {
135
- console.error('❌ Error creating agent:', error);
136
- return {
137
- success: false,
138
- error: {
139
- message: 'Network error',
140
- error: 'Failed to connect to server',
141
- statusCode: 500
142
- }
143
- };
144
- }
145
- }
146
- export async function getAgentDetails(apiKey, agentId) {
147
- try {
148
- const response = await fetch(`https://api.lua.dev/admin/agents/${agentId}`, {
149
- method: 'GET',
150
- headers: {
151
- 'Authorization': `Bearer ${apiKey}`,
152
- 'Content-Type': 'application/json'
153
- }
154
- });
155
- const data = await response.json();
156
- if (response.ok) {
157
- return {
158
- success: true,
159
- data: data
160
- };
161
- }
162
- else {
163
- return {
164
- success: false,
165
- error: data
166
- };
167
- }
168
- }
169
- catch (error) {
170
- console.error('❌ Error fetching agent details:', error);
171
- return {
172
- success: false,
173
- error: {
174
- message: 'Network error',
175
- error: 'Failed to connect to server',
176
- statusCode: 500
177
- }
178
- };
179
- }
180
- }
52
+ // API functions moved to centralized ApiService and api.ts
53
+ // Use ApiService.getAgentTypes(), ApiService.createAgent(), ApiService.getAgentDetails() instead
package/dist/skill.d.ts CHANGED
@@ -16,11 +16,16 @@ export { LuaTool };
16
16
  */
17
17
  export declare const env: (key: string) => string | undefined;
18
18
  export interface LuaSkillConfig {
19
+ name?: string;
20
+ version?: string;
19
21
  description: string;
20
22
  context: string;
23
+ tools?: LuaTool<any>[];
21
24
  }
22
25
  export declare class LuaSkill {
23
26
  private readonly tools;
27
+ private readonly name;
28
+ private readonly version;
24
29
  private readonly description;
25
30
  private readonly context;
26
31
  /**
package/dist/skill.js CHANGED
@@ -59,8 +59,14 @@ export class LuaSkill {
59
59
  */
60
60
  constructor(config) {
61
61
  this.tools = [];
62
+ this.name = config.name || 'unnamed-skill';
63
+ this.version = config.version || '1.0.0';
62
64
  this.description = config.description;
63
65
  this.context = config.context;
66
+ // Add tools from constructor if provided
67
+ if (config.tools) {
68
+ this.addTools(config.tools);
69
+ }
64
70
  }
65
71
  addTool(tool) {
66
72
  // Validate the tool name before adding it
@@ -69,11 +69,15 @@ export interface LuaTool<TInput extends ZodType = ZodType> {
69
69
  execute: (input: any) => Promise<any>;
70
70
  }
71
71
  export interface LuaSkillConfig {
72
+ name: string;
73
+ version: string;
72
74
  description: string;
73
75
  context: string;
74
76
  }
75
77
  export declare class LuaSkill {
76
78
  private readonly tools;
79
+ private readonly name;
80
+ private readonly version;
77
81
  private readonly description;
78
82
  private readonly context;
79
83
  constructor(config: LuaSkillConfig);
@@ -1,5 +1,5 @@
1
1
  export declare function copyTemplateFiles(templateDir: string, targetDir: string): void;
2
- export declare function createSkillYaml(agentId: string, orgId: string, skillName: string, skillId?: string, persona?: string, welcomeMessage?: string): void;
2
+ export declare function createSkillYaml(agentId: string, orgId: string, skillName?: string, skillId?: string, persona?: string, welcomeMessage?: string): void;
3
3
  export declare function readSkillYaml(): any;
4
4
  export declare function readSkillConfig(): any;
5
5
  export declare function updateSkillYamlPersona(persona: string, welcomeMessage?: string): void;