lua-cli 3.0.0-alpha.6 → 3.0.0-alpha.8
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/commands/push.js
CHANGED
|
@@ -1143,15 +1143,10 @@ async function pushAllCommand(options) {
|
|
|
1143
1143
|
// Auto-bump patch version
|
|
1144
1144
|
const newVersion = bumpPatchVersion(currentVersion);
|
|
1145
1145
|
writeInfo(` 📝 ${skillConfig.name}: ${currentVersion} → ${newVersion}`);
|
|
1146
|
-
// Push version
|
|
1146
|
+
// Push version - use the full skillData with tools
|
|
1147
1147
|
const pushResult = await pushVersion(apiKey, agentId, skillId, {
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
context: skillConfig.context || '',
|
|
1151
|
-
code: skillData.code,
|
|
1152
|
-
executeFunction: skillData.executeFunction,
|
|
1153
|
-
inputSchema: skillData.inputSchema,
|
|
1154
|
-
outputSchema: skillData.outputSchema,
|
|
1148
|
+
...skillData, // Include all fields from deploy.json (tools, name, etc.)
|
|
1149
|
+
version: newVersion, // Override with new version
|
|
1155
1150
|
});
|
|
1156
1151
|
if (!pushResult.success) {
|
|
1157
1152
|
console.error(` ❌ Failed to push ${skillConfig.name}:`, pushResult.error?.message);
|
package/dist/services/auth.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
*
|
|
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
|
/**
|
package/dist/services/auth.js
CHANGED
|
@@ -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
|
|
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
|
-
*
|
|
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
|
-
|
|
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
package/template/env.example
CHANGED
|
@@ -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
|
|
package/template/lua.skill.yaml
CHANGED
|
@@ -36,34 +36,34 @@ agent:
|
|
|
36
36
|
welcomeMessage: Hi, I am your AI assistant. How can I help you today?
|
|
37
37
|
skills:
|
|
38
38
|
- name: general-skill
|
|
39
|
-
version: 0.0.
|
|
39
|
+
version: 0.0.6
|
|
40
40
|
skillId: 1faf9b3a-e352-4e63-a6c4-a3deca815361
|
|
41
41
|
- name: user-data-skill
|
|
42
|
-
version: 0.0.
|
|
42
|
+
version: 0.0.15
|
|
43
43
|
skillId: e0c382c1-f469-4880-962a-a756ea3c1411
|
|
44
44
|
- name: product-skill
|
|
45
|
-
version: 0.0.
|
|
45
|
+
version: 0.0.15
|
|
46
46
|
skillId: d4cdc7bc-6d42-4232-902d-2b9cf68bd74a
|
|
47
47
|
- name: basket-skill
|
|
48
|
-
version: 0.0.
|
|
48
|
+
version: 0.0.14
|
|
49
49
|
skillId: 5b06c5ff-7cf3-49c4-8641-142270c81db4
|
|
50
50
|
- name: order-skill
|
|
51
|
-
version: 0.0.
|
|
51
|
+
version: 0.0.14
|
|
52
52
|
skillId: d4045304-7c30-4750-9edd-340eb1357a39
|
|
53
53
|
- name: custom-data-skill
|
|
54
|
-
version: 0.0.
|
|
54
|
+
version: 0.0.13
|
|
55
55
|
skillId: 83fe411c-90a1-4bd3-9271-ac8e03d6a3be
|
|
56
56
|
- name: payment-skill
|
|
57
|
-
version: 0.0.
|
|
57
|
+
version: 0.0.13
|
|
58
58
|
skillId: f2248c02-c6c6-4c3a-89bf-ff09ec11529a
|
|
59
59
|
jobs:
|
|
60
60
|
- name: test-job
|
|
61
|
-
version: 1.0.
|
|
61
|
+
version: 1.0.13
|
|
62
62
|
jobId: d66b73a0-f944-4718-b6a2-f07bfeabd625
|
|
63
63
|
schedule:
|
|
64
64
|
type: once
|
|
65
65
|
executeAt: '2025-10-20T01:08:04.639Z'
|
|
66
66
|
webhooks:
|
|
67
67
|
- name: test-webhook
|
|
68
|
-
version: 1.0.
|
|
68
|
+
version: 1.0.12
|
|
69
69
|
webhookId: c967fd58-1d4d-49b6-8fa6-ec36b4d23e7f
|