lua-cli 3.0.0-alpha.7 → 3.0.0-alpha.9

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.
@@ -123,8 +123,10 @@ async function startChatLoop(chatEnv) {
123
123
  console.log(`Environment: ${chatEnv.type === 'sandbox' ? '🔧 Sandbox' : '🚀 Production'}`);
124
124
  console.log("Press Ctrl+C to exit");
125
125
  console.log("=".repeat(60) + "\n");
126
- // Welcome message
127
- console.log("🌙 Assistant: Hi there! How can I help you today?\n");
126
+ // Welcome message from config or default
127
+ const config = readSkillConfig();
128
+ const welcomeMessage = config?.agent?.welcomeMessage || "Hi there! How can I help you today?";
129
+ console.log(`🌙 Assistant: ${welcomeMessage}\n`);
128
130
  // Create readline interface
129
131
  const rl = readline.createInterface({
130
132
  input: process.stdin,
@@ -13,9 +13,15 @@ import { UserData } from "../interfaces/admin.js";
13
13
  */
14
14
  export declare function saveApiKey(apiKey: string): Promise<void>;
15
15
  /**
16
- * Loads API key from secure system keychain.
16
+ * Loads API key from multiple sources in priority order:
17
+ * 1. Secure system keychain (macOS Keychain, Windows Credential Vault, Linux libsecret)
18
+ * 2. LUA_API_KEY environment variable
19
+ * 3. LUA_API_KEY from .env file
17
20
  *
18
- * @returns Promise resolving to API key or null if not found
21
+ * This fallback mechanism allows the CLI to work in CI/CD environments where
22
+ * keychain access isn't available.
23
+ *
24
+ * @returns Promise resolving to API key or null if not found in any source
19
25
  */
20
26
  export declare function loadApiKey(): Promise<string | null>;
21
27
  /**
@@ -22,12 +22,44 @@ export async function saveApiKey(apiKey) {
22
22
  await keytar.setPassword(KEYTAR_SERVICE, KEYTAR_ACCOUNT, apiKey);
23
23
  }
24
24
  /**
25
- * Loads API key from secure system keychain.
25
+ * Loads API key from multiple sources in priority order:
26
+ * 1. Secure system keychain (macOS Keychain, Windows Credential Vault, Linux libsecret)
27
+ * 2. LUA_API_KEY environment variable
28
+ * 3. LUA_API_KEY from .env file
26
29
  *
27
- * @returns Promise resolving to API key or null if not found
30
+ * This fallback mechanism allows the CLI to work in CI/CD environments where
31
+ * keychain access isn't available.
32
+ *
33
+ * @returns Promise resolving to API key or null if not found in any source
28
34
  */
29
35
  export async function loadApiKey() {
30
- return keytar.getPassword(KEYTAR_SERVICE, KEYTAR_ACCOUNT);
36
+ // Priority 1: Check secure system keychain
37
+ const keychainKey = await keytar.getPassword(KEYTAR_SERVICE, KEYTAR_ACCOUNT);
38
+ if (keychainKey) {
39
+ return keychainKey;
40
+ }
41
+ // Priority 2: Check environment variable
42
+ if (process.env.LUA_API_KEY) {
43
+ return process.env.LUA_API_KEY;
44
+ }
45
+ // Priority 3: Check .env file
46
+ try {
47
+ const fs = await import('fs');
48
+ const path = await import('path');
49
+ const envPath = path.join(process.cwd(), '.env');
50
+ if (fs.existsSync(envPath)) {
51
+ const envContent = fs.readFileSync(envPath, 'utf8');
52
+ const match = envContent.match(/^LUA_API_KEY=(.+)$/m);
53
+ if (match && match[1]) {
54
+ // Remove quotes if present
55
+ return match[1].trim().replace(/^["']|["']$/g, '');
56
+ }
57
+ }
58
+ }
59
+ catch (error) {
60
+ // Silently fail if .env file can't be read
61
+ }
62
+ return null;
31
63
  }
32
64
  /**
33
65
  * Deletes API key from secure system keychain.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lua-cli",
3
- "version": "3.0.0-alpha.7",
3
+ "version": "3.0.0-alpha.9",
4
4
  "description": "Command-line interface for Lua AI platform - develop, test, and deploy LuaSkills with custom tools",
5
5
  "readmeFilename": "README.md",
6
6
  "main": "dist/api-exports.js",
@@ -1,6 +1,11 @@
1
1
  # Example environment variables file
2
2
  # Copy this to .env and update with your actual API keys
3
3
 
4
+ # Lua API Key (optional - fallback if not in keychain)
5
+ # Use this for CI/CD environments or if you prefer .env over keychain
6
+ # Priority: 1. Keychain, 2. Environment variable, 3. .env file
7
+ # LUA_API_KEY=your-lua-api-key-here
8
+
4
9
  # OpenAI API Key (for AI tools)
5
10
  OPENAI_API_KEY=your-openai-api-key-here
6
11
 
@@ -1,38 +1,16 @@
1
1
  agent:
2
2
  agentId: baseAgent_agent_1760922427216_fk9w0ezhh
3
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
6
- specializes in bringing a splash of color and excitement to everyday life. Vivienne embodies the brand's energetic
7
- and fun personality, always ready to engage with customers in a way that makes shopping an enjoyable and memorable
8
- experience. Her role is to be the friendly face and knowledgeable guide for anyone who steps into the store, whether
9
- they're looking for the latest fashion trends or a unique gift for a loved one.
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.
10
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.
11
8
 
12
- V3 Test is all about creating a joyful and spirited shopping environment, and Vivienne is the perfect
13
- personification of this ethos. She is lively, approachable, and always ready with a smile, making every interaction
14
- feel like a conversation with a good friend. Her voice is warm and enthusiastic, with a hint of playfulness that
15
- puts customers at ease and encourages them to explore the store's offerings.
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.
16
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.
17
12
 
18
- Vivienne's target customers are diverse, ranging from young adults in their twenties who are fashion-forward and
19
- tech-savvy, to busy parents looking for quality products that add a touch of fun to their family life. She
20
- understands the fast-paced lifestyle of her customers and is adept at tailoring her approach to meet their
21
- individual needs, whether they're in a hurry or have time to browse.
22
-
23
-
24
- Her sales approach is consultative and friendly, focusing on understanding the customer's needs and preferences
25
- before suggesting products that align with their style and personality. Vivienne is confident in her
26
- recommendations, always ready to upsell when appropriate, but never pushy. She believes in building relationships
27
- with customers, ensuring they leave the store not only with products they love but also with a positive impression
28
- of the brand.
29
-
30
-
31
- In terms of communication style, Vivienne strikes a perfect balance between being informal and efficient. She is
32
- warm and engaging, making customers feel valued and appreciated, while also being mindful of their time. Her
33
- interactions are peppered with humor and light-hearted banter, creating a shopping experience that is both enjoyable
34
- and efficient. Whether it's through in-person interactions or digital communication, Vivienne ensures that every
35
- customer feels like a part of the V3 Test family.
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.
36
14
  welcomeMessage: Hi, I am your AI assistant. How can I help you today?
37
15
  skills:
38
16
  - name: general-skill