lua-cli 3.7.5 → 3.9.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.
- package/README.md +90 -2
- package/dist/api/webhook.api.service.d.ts +10 -1
- package/dist/api/webhook.api.service.d.ts.map +1 -1
- package/dist/api/webhook.api.service.js +5 -0
- package/dist/api/webhook.api.service.js.map +1 -1
- package/dist/cli/command-definitions.d.ts.map +1 -1
- package/dist/cli/command-definitions.js +42 -26
- package/dist/cli/command-definitions.js.map +1 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +2 -11
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/apiKey.d.ts +1 -21
- package/dist/commands/apiKey.d.ts.map +1 -1
- package/dist/commands/apiKey.js +7 -25
- package/dist/commands/apiKey.js.map +1 -1
- package/dist/commands/compile.d.ts.map +1 -1
- package/dist/commands/compile.js +11 -3
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/configure.d.ts +2 -2
- package/dist/commands/configure.js +2 -2
- package/dist/commands/deploy.d.ts +7 -9
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +380 -123
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/destroy.d.ts +0 -24
- package/dist/commands/destroy.d.ts.map +1 -1
- package/dist/commands/destroy.js +8 -30
- package/dist/commands/destroy.js.map +1 -1
- package/dist/commands/jobs.js +57 -32
- package/dist/commands/jobs.js.map +1 -1
- package/dist/commands/postprocessors.js +2 -2
- package/dist/commands/postprocessors.js.map +1 -1
- package/dist/commands/preprocessors.js +2 -2
- package/dist/commands/preprocessors.js.map +1 -1
- package/dist/commands/webhooks.d.ts.map +1 -1
- package/dist/commands/webhooks.js +128 -6
- package/dist/commands/webhooks.js.map +1 -1
- package/dist/config/constants.d.ts +7 -11
- package/dist/config/constants.d.ts.map +1 -1
- package/dist/config/constants.js +7 -11
- package/dist/config/constants.js.map +1 -1
- package/dist/index.js +0 -0
- package/dist/interfaces/webhooks.d.ts +6 -0
- package/dist/interfaces/webhooks.d.ts.map +1 -1
- package/dist/services/analytics.d.ts.map +1 -1
- package/dist/services/analytics.js +6 -2
- package/dist/services/analytics.js.map +1 -1
- package/dist/services/auth.d.ts +16 -26
- package/dist/services/auth.d.ts.map +1 -1
- package/dist/services/auth.js +45 -101
- package/dist/services/auth.js.map +1 -1
- package/dist/utils/auth-flows.d.ts.map +1 -1
- package/dist/utils/auth-flows.js +8 -12
- package/dist/utils/auth-flows.js.map +1 -1
- package/dist/utils/cli.d.ts.map +1 -1
- package/dist/utils/cli.js +2 -3
- package/dist/utils/cli.js.map +1 -1
- package/dist/utils/command-utils.d.ts +4 -3
- package/dist/utils/command-utils.d.ts.map +1 -1
- package/dist/utils/command-utils.js +9 -20
- package/dist/utils/command-utils.js.map +1 -1
- package/dist/utils/files.d.ts +1 -5
- package/dist/utils/files.d.ts.map +1 -1
- package/dist/utils/files.js +3 -12
- package/dist/utils/files.js.map +1 -1
- package/dist/utils/sandbox-storage.d.ts +18 -18
- package/dist/utils/sandbox-storage.d.ts.map +1 -1
- package/dist/utils/sandbox-storage.js +77 -101
- package/dist/utils/sandbox-storage.js.map +1 -1
- package/package.json +4 -6
- package/template/package.json +1 -1
- package/dist/utils/keytar-loader.d.ts +0 -20
- package/dist/utils/keytar-loader.d.ts.map +0 -1
- package/dist/utils/keytar-loader.js +0 -35
- package/dist/utils/keytar-loader.js.map +0 -1
- package/node_modules/@lua/shared-types/dist/index.d.mts +0 -92
- package/node_modules/@lua/shared-types/dist/index.d.ts +0 -92
- package/node_modules/@lua/shared-types/dist/index.js +0 -104
- package/node_modules/@lua/shared-types/dist/index.mjs +0 -79
|
@@ -1,53 +1,63 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Sandbox Storage Utilities
|
|
3
|
-
* Handles
|
|
3
|
+
* Handles storage and retrieval of sandbox primitive IDs using a local JSON file
|
|
4
|
+
* at ~/.lua-cli/sandbox.json. Replaces the previous keytar-based implementation.
|
|
4
5
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
6
|
+
import { readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
7
|
+
import { dirname } from 'path';
|
|
8
|
+
import { SANDBOX_STORAGE_FILE } from '../config/constants.js';
|
|
7
9
|
import { skillHandler, preprocessorHandler, postprocessorHandler } from '../primitives/index.js';
|
|
10
|
+
function readStore() {
|
|
11
|
+
try {
|
|
12
|
+
const raw = readFileSync(SANDBOX_STORAGE_FILE, 'utf8');
|
|
13
|
+
const parsed = JSON.parse(raw);
|
|
14
|
+
return {
|
|
15
|
+
skills: parsed.skills ?? {},
|
|
16
|
+
preprocessors: parsed.preprocessors ?? {},
|
|
17
|
+
postprocessors: parsed.postprocessors ?? {},
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return { skills: {}, preprocessors: {}, postprocessors: {} };
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function writeStore(store) {
|
|
25
|
+
try {
|
|
26
|
+
mkdirSync(dirname(SANDBOX_STORAGE_FILE), { recursive: true });
|
|
27
|
+
writeFileSync(SANDBOX_STORAGE_FILE, JSON.stringify(store, null, 2), 'utf8');
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
// Silently ignore write failures — sandbox IDs are transient dev-time values
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// =============================================================================
|
|
34
|
+
// Skill sandbox IDs
|
|
35
|
+
// =============================================================================
|
|
8
36
|
/**
|
|
9
|
-
* Retrieves sandbox skill ID from
|
|
37
|
+
* Retrieves sandbox skill ID from local storage.
|
|
10
38
|
*
|
|
11
39
|
* @param skillName - Optional skill name for multi-skill projects
|
|
12
40
|
* @returns The sandbox skill ID or null if not found
|
|
13
41
|
*/
|
|
14
42
|
export async function getSandboxSkillId(skillName) {
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
try {
|
|
19
|
-
const account = skillName
|
|
20
|
-
? `${SANDBOX_STORAGE.ACCOUNT}_${skillName}`
|
|
21
|
-
: SANDBOX_STORAGE.ACCOUNT;
|
|
22
|
-
return await keytar.getPassword(SANDBOX_STORAGE.SERVICE, account);
|
|
23
|
-
}
|
|
24
|
-
catch (error) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
43
|
+
const store = readStore();
|
|
44
|
+
const key = skillName ?? '__default__';
|
|
45
|
+
return store.skills[key] ?? null;
|
|
27
46
|
}
|
|
28
47
|
/**
|
|
29
|
-
* Stores sandbox skill ID in
|
|
48
|
+
* Stores sandbox skill ID in local storage.
|
|
30
49
|
*
|
|
31
50
|
* @param sandboxId - The sandbox skill ID to store
|
|
32
51
|
* @param skillName - Optional skill name for multi-skill projects
|
|
33
52
|
*/
|
|
34
53
|
export async function setSandboxSkillId(sandboxId, skillName) {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const account = skillName
|
|
40
|
-
? `${SANDBOX_STORAGE.ACCOUNT}_${skillName}`
|
|
41
|
-
: SANDBOX_STORAGE.ACCOUNT;
|
|
42
|
-
await keytar.setPassword(SANDBOX_STORAGE.SERVICE, account, sandboxId);
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
// Ignore storage errors
|
|
46
|
-
}
|
|
54
|
+
const store = readStore();
|
|
55
|
+
const key = skillName ?? '__default__';
|
|
56
|
+
store.skills[key] = sandboxId;
|
|
57
|
+
writeStore(store);
|
|
47
58
|
}
|
|
48
59
|
/**
|
|
49
60
|
* Retrieves all sandbox skill IDs for all skills in the project.
|
|
50
|
-
* Uses YAML config to get skill names and IDs.
|
|
51
61
|
*
|
|
52
62
|
* @param yamlConfig - The lua.skill.yaml config containing skill information
|
|
53
63
|
* @returns Array of skill overrides with skillId and sandboxId pairs
|
|
@@ -56,15 +66,11 @@ export async function getAllSandboxSkillIds(yamlConfig) {
|
|
|
56
66
|
try {
|
|
57
67
|
const skills = skillHandler.getFromYaml(yamlConfig);
|
|
58
68
|
const skillOverrides = [];
|
|
59
|
-
// For each skill in YAML, get its sandbox ID
|
|
60
69
|
for (const skill of skills) {
|
|
61
70
|
if (skill.skillId && skill.name) {
|
|
62
71
|
const sandboxId = await getSandboxSkillId(skill.name);
|
|
63
72
|
if (sandboxId) {
|
|
64
|
-
skillOverrides.push({
|
|
65
|
-
skillId: skill.skillId,
|
|
66
|
-
sandboxId: sandboxId
|
|
67
|
-
});
|
|
73
|
+
skillOverrides.push({ skillId: skill.skillId, sandboxId });
|
|
68
74
|
}
|
|
69
75
|
}
|
|
70
76
|
}
|
|
@@ -75,77 +81,29 @@ export async function getAllSandboxSkillIds(yamlConfig) {
|
|
|
75
81
|
return [];
|
|
76
82
|
}
|
|
77
83
|
}
|
|
84
|
+
// =============================================================================
|
|
85
|
+
// Preprocessor sandbox IDs
|
|
86
|
+
// =============================================================================
|
|
78
87
|
/**
|
|
79
|
-
* Retrieves sandbox preprocessor ID from
|
|
88
|
+
* Retrieves sandbox preprocessor ID from local storage.
|
|
80
89
|
*
|
|
81
90
|
* @param preprocessorName - Preprocessor name
|
|
82
91
|
* @returns The sandbox preprocessor ID or null if not found
|
|
83
92
|
*/
|
|
84
93
|
export async function getSandboxPreProcessorId(preprocessorName) {
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
return null;
|
|
88
|
-
try {
|
|
89
|
-
const account = `${SANDBOX_STORAGE.ACCOUNT}_preprocessor_${preprocessorName}`;
|
|
90
|
-
return await keytar.getPassword(SANDBOX_STORAGE.SERVICE, account);
|
|
91
|
-
}
|
|
92
|
-
catch (error) {
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
94
|
+
const store = readStore();
|
|
95
|
+
return store.preprocessors[preprocessorName] ?? null;
|
|
95
96
|
}
|
|
96
97
|
/**
|
|
97
|
-
* Stores sandbox preprocessor ID in
|
|
98
|
+
* Stores sandbox preprocessor ID in local storage.
|
|
98
99
|
*
|
|
99
100
|
* @param sandboxId - The sandbox preprocessor ID to store
|
|
100
101
|
* @param preprocessorName - Preprocessor name
|
|
101
102
|
*/
|
|
102
103
|
export async function setSandboxPreProcessorId(sandboxId, preprocessorName) {
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
try {
|
|
107
|
-
const account = `${SANDBOX_STORAGE.ACCOUNT}_preprocessor_${preprocessorName}`;
|
|
108
|
-
await keytar.setPassword(SANDBOX_STORAGE.SERVICE, account, sandboxId);
|
|
109
|
-
}
|
|
110
|
-
catch (error) {
|
|
111
|
-
// Ignore storage errors
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Retrieves sandbox postprocessor ID from secure storage.
|
|
116
|
-
*
|
|
117
|
-
* @param postprocessorName - Postprocessor name
|
|
118
|
-
* @returns The sandbox postprocessor ID or null if not found
|
|
119
|
-
*/
|
|
120
|
-
export async function getSandboxPostProcessorId(postprocessorName) {
|
|
121
|
-
const keytar = await getKeytar();
|
|
122
|
-
if (!keytar)
|
|
123
|
-
return null;
|
|
124
|
-
try {
|
|
125
|
-
const account = `${SANDBOX_STORAGE.ACCOUNT}_postprocessor_${postprocessorName}`;
|
|
126
|
-
return await keytar.getPassword(SANDBOX_STORAGE.SERVICE, account);
|
|
127
|
-
}
|
|
128
|
-
catch (error) {
|
|
129
|
-
return null;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Stores sandbox postprocessor ID in secure storage.
|
|
134
|
-
*
|
|
135
|
-
* @param sandboxId - The sandbox postprocessor ID to store
|
|
136
|
-
* @param postprocessorName - Postprocessor name
|
|
137
|
-
*/
|
|
138
|
-
export async function setSandboxPostProcessorId(sandboxId, postprocessorName) {
|
|
139
|
-
const keytar = await getKeytar();
|
|
140
|
-
if (!keytar)
|
|
141
|
-
return;
|
|
142
|
-
try {
|
|
143
|
-
const account = `${SANDBOX_STORAGE.ACCOUNT}_postprocessor_${postprocessorName}`;
|
|
144
|
-
await keytar.setPassword(SANDBOX_STORAGE.SERVICE, account, sandboxId);
|
|
145
|
-
}
|
|
146
|
-
catch (error) {
|
|
147
|
-
// Ignore storage errors
|
|
148
|
-
}
|
|
104
|
+
const store = readStore();
|
|
105
|
+
store.preprocessors[preprocessorName] = sandboxId;
|
|
106
|
+
writeStore(store);
|
|
149
107
|
}
|
|
150
108
|
/**
|
|
151
109
|
* Gets all sandbox preprocessor overrides for the current config.
|
|
@@ -161,10 +119,7 @@ export async function getAllSandboxPreProcessorIds(config) {
|
|
|
161
119
|
if (preprocessor.preprocessorId && preprocessor.name) {
|
|
162
120
|
const sandboxId = await getSandboxPreProcessorId(preprocessor.name);
|
|
163
121
|
if (sandboxId) {
|
|
164
|
-
overrides.push({
|
|
165
|
-
preprocessorId: preprocessor.preprocessorId,
|
|
166
|
-
sandboxId: sandboxId
|
|
167
|
-
});
|
|
122
|
+
overrides.push({ preprocessorId: preprocessor.preprocessorId, sandboxId });
|
|
168
123
|
}
|
|
169
124
|
}
|
|
170
125
|
}
|
|
@@ -174,6 +129,30 @@ export async function getAllSandboxPreProcessorIds(config) {
|
|
|
174
129
|
}
|
|
175
130
|
return overrides;
|
|
176
131
|
}
|
|
132
|
+
// =============================================================================
|
|
133
|
+
// Postprocessor sandbox IDs
|
|
134
|
+
// =============================================================================
|
|
135
|
+
/**
|
|
136
|
+
* Retrieves sandbox postprocessor ID from local storage.
|
|
137
|
+
*
|
|
138
|
+
* @param postprocessorName - Postprocessor name
|
|
139
|
+
* @returns The sandbox postprocessor ID or null if not found
|
|
140
|
+
*/
|
|
141
|
+
export async function getSandboxPostProcessorId(postprocessorName) {
|
|
142
|
+
const store = readStore();
|
|
143
|
+
return store.postprocessors[postprocessorName] ?? null;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Stores sandbox postprocessor ID in local storage.
|
|
147
|
+
*
|
|
148
|
+
* @param sandboxId - The sandbox postprocessor ID to store
|
|
149
|
+
* @param postprocessorName - Postprocessor name
|
|
150
|
+
*/
|
|
151
|
+
export async function setSandboxPostProcessorId(sandboxId, postprocessorName) {
|
|
152
|
+
const store = readStore();
|
|
153
|
+
store.postprocessors[postprocessorName] = sandboxId;
|
|
154
|
+
writeStore(store);
|
|
155
|
+
}
|
|
177
156
|
/**
|
|
178
157
|
* Gets all sandbox postprocessor overrides for the current config.
|
|
179
158
|
*
|
|
@@ -188,10 +167,7 @@ export async function getAllSandboxPostProcessorIds(config) {
|
|
|
188
167
|
if (postprocessor.postprocessorId && postprocessor.name) {
|
|
189
168
|
const sandboxId = await getSandboxPostProcessorId(postprocessor.name);
|
|
190
169
|
if (sandboxId) {
|
|
191
|
-
overrides.push({
|
|
192
|
-
postprocessorId: postprocessor.postprocessorId,
|
|
193
|
-
sandboxId: sandboxId
|
|
194
|
-
});
|
|
170
|
+
overrides.push({ postprocessorId: postprocessor.postprocessorId, sandboxId });
|
|
195
171
|
}
|
|
196
172
|
}
|
|
197
173
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox-storage.js","sourceRoot":"","sources":["../../src/utils/sandbox-storage.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"sandbox-storage.js","sourceRoot":"","sources":["../../src/utils/sandbox-storage.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAYjG,SAAS,SAAS;IAChB,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,YAAY,CAAC,oBAAoB,EAAE,MAAM,CAAC,CAAC;QACvD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,OAAO;YAC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AoB,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAEhE,KAAK,MAAM,aAAa,IAAI,cAAc,EAAE,CAAC;YAC3C,IAAI,aAAa,CAAC,eAAe,IAAI,aAAa,CAAC,IAAI,EAAE,CAAC;gBACxD,MAAM,SAAS,GAAG,MAAM,yBAAyB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;gBACtE,IAAI,SAAS,EAAE,CAAC;oBACd,SAAS,CAAC,IAAI,CAAC,EAAE,eAAe,EAAE,aAAa,CAAC,eAAe,EAAE,SAAS,EAAE,CAAC,CAAC;gBAChF,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,0CAA0C,EAAE,KAAK,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lua-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "Build, test, and deploy AI agents with custom tools, webhooks, and scheduled jobs. Features LuaAgent unified configuration, streaming chat, and batch deployment.",
|
|
5
5
|
"readmeFilename": "README.md",
|
|
6
6
|
"main": "dist/api-exports.js",
|
|
@@ -40,9 +40,10 @@
|
|
|
40
40
|
"type": "module",
|
|
41
41
|
"repository": {
|
|
42
42
|
"type": "git",
|
|
43
|
-
"url": "git+https://github.com/lua-ai-global/lua-
|
|
43
|
+
"url": "git+https://github.com/lua-ai-global/lua-core-services.git",
|
|
44
|
+
"directory": "packages/lua-cli"
|
|
44
45
|
},
|
|
45
|
-
"homepage": "https://github.com/lua-ai-global/lua-cli#readme",
|
|
46
|
+
"homepage": "https://github.com/lua-ai-global/lua-core-services/tree/main/packages/lua-cli#readme",
|
|
46
47
|
"readme": "README.md",
|
|
47
48
|
"bugs": {
|
|
48
49
|
"url": "https://github.com/lua-ai-global/lua-cli/issues"
|
|
@@ -82,9 +83,6 @@
|
|
|
82
83
|
"bundledDependencies": [
|
|
83
84
|
"@lua/shared-types"
|
|
84
85
|
],
|
|
85
|
-
"optionalDependencies": {
|
|
86
|
-
"keytar": "^7.9.0"
|
|
87
|
-
},
|
|
88
86
|
"devDependencies": {
|
|
89
87
|
"@types/diff": "^7.0.2",
|
|
90
88
|
"@types/inquirer": "^9.0.9",
|
package/template/package.json
CHANGED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lazy Keytar Loader
|
|
3
|
-
*
|
|
4
|
-
* Defers the native keytar module import until first use and skips it
|
|
5
|
-
* entirely when LUA_SKIP_KEYCHAIN is set. This allows lua-cli to run
|
|
6
|
-
* in environments where native Node.js addons are unavailable
|
|
7
|
-
* (StackBlitz WebContainers, certain CI runners, etc.).
|
|
8
|
-
*
|
|
9
|
-
* The promise is cached so the dynamic import runs at most once per
|
|
10
|
-
* process, even under concurrent calls.
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Returns the keytar module or null.
|
|
14
|
-
*
|
|
15
|
-
* - Returns null immediately if LUA_SKIP_KEYCHAIN is set.
|
|
16
|
-
* - Caches the import promise so concurrent callers share the same
|
|
17
|
-
* in-flight request and failed imports are not retried.
|
|
18
|
-
*/
|
|
19
|
-
export declare function getKeytar(): Promise<typeof import("keytar") | null>;
|
|
20
|
-
//# sourceMappingURL=keytar-loader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keytar-loader.d.ts","sourceRoot":"","sources":["../../src/utils/keytar-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH;;;;;;GAMG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,cAAc,QAAQ,CAAC,GAAG,IAAI,CAAC,CAWzE"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lazy Keytar Loader
|
|
3
|
-
*
|
|
4
|
-
* Defers the native keytar module import until first use and skips it
|
|
5
|
-
* entirely when LUA_SKIP_KEYCHAIN is set. This allows lua-cli to run
|
|
6
|
-
* in environments where native Node.js addons are unavailable
|
|
7
|
-
* (StackBlitz WebContainers, certain CI runners, etc.).
|
|
8
|
-
*
|
|
9
|
-
* The promise is cached so the dynamic import runs at most once per
|
|
10
|
-
* process, even under concurrent calls.
|
|
11
|
-
*/
|
|
12
|
-
let _keytarPromise = null;
|
|
13
|
-
/**
|
|
14
|
-
* Returns the keytar module or null.
|
|
15
|
-
*
|
|
16
|
-
* - Returns null immediately if LUA_SKIP_KEYCHAIN is set.
|
|
17
|
-
* - Caches the import promise so concurrent callers share the same
|
|
18
|
-
* in-flight request and failed imports are not retried.
|
|
19
|
-
*/
|
|
20
|
-
export async function getKeytar() {
|
|
21
|
-
if (process.env.LUA_SKIP_KEYCHAIN)
|
|
22
|
-
return null;
|
|
23
|
-
if (!_keytarPromise) {
|
|
24
|
-
_keytarPromise = import("keytar").then((mod) => {
|
|
25
|
-
// Handle ESM/CJS interop: keytar methods may live on mod.default
|
|
26
|
-
if (typeof mod.setPassword === 'function')
|
|
27
|
-
return mod;
|
|
28
|
-
if (mod.default && typeof mod.default.setPassword === 'function')
|
|
29
|
-
return mod.default;
|
|
30
|
-
return null;
|
|
31
|
-
}).catch(() => null);
|
|
32
|
-
}
|
|
33
|
-
return _keytarPromise;
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=keytar-loader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"keytar-loader.js","sourceRoot":"","sources":["../../src/utils/keytar-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,IAAI,cAAc,GAAmD,IAAI,CAAC;AAE1E;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB;QAAE,OAAO,IAAI,CAAC;IAC/C,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;YAC7C,iEAAiE;YACjE,IAAI,OAAO,GAAG,CAAC,WAAW,KAAK,UAAU;gBAAE,OAAO,GAAG,CAAC;YACtD,IAAI,GAAG,CAAC,OAAO,IAAI,OAAO,GAAG,CAAC,OAAO,CAAC,WAAW,KAAK,UAAU;gBAAE,OAAO,GAAG,CAAC,OAAqB,CAAC;YACnG,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { FinishReason, LanguageModelUsage, ReasoningOutput, CallWarning, UserContent } from 'ai';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Channel type.
|
|
5
|
-
* Represents the communication channel through which a request originated.
|
|
6
|
-
* Known channels are typed as string literals, unrecognized channels are unknown.
|
|
7
|
-
*/
|
|
8
|
-
type Channel = 'web' | 'whatsapp' | 'facebook' | 'instagram' | 'slack' | 'teams' | 'messagebird' | 'front' | 'api' | 'dev' | 'email' | 'rcs' | 'sms' | 'mms' | string;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* MIME types supported by Unstructured.io for document text extraction.
|
|
12
|
-
* Source: https://docs.unstructured.io/api-reference/supported-file-types
|
|
13
|
-
*
|
|
14
|
-
* Shared across lua-core (FileConversionService) and lua-agents (UnstructuredService).
|
|
15
|
-
*/
|
|
16
|
-
declare const UNSTRUCTURED_SUPPORTED_MEDIA_TYPES: Set<string>;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Wire-format input for sandbox `AI.generate` / `POST .../generate` (JSON-serializable).
|
|
20
|
-
* Serializable subset of AI SDK `generateText` parameters.
|
|
21
|
-
* `messages` is untyped over HTTP; callers typically send AI SDK `ModelMessage[]`.
|
|
22
|
-
*/
|
|
23
|
-
interface AiGenerateInput {
|
|
24
|
-
model?: string;
|
|
25
|
-
system?: string;
|
|
26
|
-
prompt?: string;
|
|
27
|
-
messages?: unknown[];
|
|
28
|
-
temperature?: number;
|
|
29
|
-
maxOutputTokens?: number;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* URL source from Google Search grounding.
|
|
33
|
-
* Mirrors `LanguageModelV2Source` (AI SDK `Source` type — not exported from `ai` as of v5).
|
|
34
|
-
*/
|
|
35
|
-
interface AiGenerateSource {
|
|
36
|
-
sourceType: 'url';
|
|
37
|
-
id: string;
|
|
38
|
-
url: string;
|
|
39
|
-
title?: string;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Serializable tool call. Mirrors `TypedToolCall` without generics.
|
|
43
|
-
* `input` matches the AI SDK field name (renamed from `args` in v5).
|
|
44
|
-
*/
|
|
45
|
-
interface AiGenerateToolCall {
|
|
46
|
-
type: 'tool-call';
|
|
47
|
-
toolCallId: string;
|
|
48
|
-
toolName: string;
|
|
49
|
-
input: unknown;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Serializable tool result. Mirrors `TypedToolResult` without generics.
|
|
53
|
-
* `output` matches the AI SDK field name.
|
|
54
|
-
*/
|
|
55
|
-
interface AiGenerateToolResult {
|
|
56
|
-
type: 'tool-result';
|
|
57
|
-
toolCallId: string;
|
|
58
|
-
toolName: string;
|
|
59
|
-
output: unknown;
|
|
60
|
-
isError?: boolean;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Wire-format output from `AI.generate` / `POST .../generate`.
|
|
64
|
-
* Fields mirror AI SDK `GenerateTextResult` — uses AI SDK types where exported.
|
|
65
|
-
* See https://ai-sdk.dev/docs/reference/ai-sdk-core/generate-text
|
|
66
|
-
*/
|
|
67
|
-
interface AiGenerateOutput {
|
|
68
|
-
text: string;
|
|
69
|
-
/** AI SDK `FinishReason` */
|
|
70
|
-
finishReason: FinishReason;
|
|
71
|
-
/** AI SDK `LanguageModelUsage` */
|
|
72
|
-
usage: LanguageModelUsage;
|
|
73
|
-
/** Model reasoning steps (e.g. Gemini thinking) */
|
|
74
|
-
reasoning?: ReasoningOutput[];
|
|
75
|
-
/** Concatenated reasoning text */
|
|
76
|
-
reasoningText?: string;
|
|
77
|
-
/** URL sources from Google Search grounding */
|
|
78
|
-
sources?: AiGenerateSource[];
|
|
79
|
-
/** Tool calls made during generation */
|
|
80
|
-
toolCalls?: AiGenerateToolCall[];
|
|
81
|
-
/** Tool results from generation */
|
|
82
|
-
toolResults?: AiGenerateToolResult[];
|
|
83
|
-
/** Provider warnings (e.g. unsupported settings) — AI SDK `CallWarning[]` */
|
|
84
|
-
warnings?: CallWarning[];
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Maps simplified `AI.generate(prompt, content?)` calls to wire-format input.
|
|
89
|
-
*/
|
|
90
|
-
declare function aiGenerateInputFromSimplified(prompt: string, content?: UserContent): AiGenerateInput;
|
|
91
|
-
|
|
92
|
-
export { type AiGenerateInput, type AiGenerateOutput, type AiGenerateSource, type AiGenerateToolCall, type AiGenerateToolResult, type Channel, UNSTRUCTURED_SUPPORTED_MEDIA_TYPES, aiGenerateInputFromSimplified };
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { FinishReason, LanguageModelUsage, ReasoningOutput, CallWarning, UserContent } from 'ai';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Channel type.
|
|
5
|
-
* Represents the communication channel through which a request originated.
|
|
6
|
-
* Known channels are typed as string literals, unrecognized channels are unknown.
|
|
7
|
-
*/
|
|
8
|
-
type Channel = 'web' | 'whatsapp' | 'facebook' | 'instagram' | 'slack' | 'teams' | 'messagebird' | 'front' | 'api' | 'dev' | 'email' | 'rcs' | 'sms' | 'mms' | string;
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* MIME types supported by Unstructured.io for document text extraction.
|
|
12
|
-
* Source: https://docs.unstructured.io/api-reference/supported-file-types
|
|
13
|
-
*
|
|
14
|
-
* Shared across lua-core (FileConversionService) and lua-agents (UnstructuredService).
|
|
15
|
-
*/
|
|
16
|
-
declare const UNSTRUCTURED_SUPPORTED_MEDIA_TYPES: Set<string>;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Wire-format input for sandbox `AI.generate` / `POST .../generate` (JSON-serializable).
|
|
20
|
-
* Serializable subset of AI SDK `generateText` parameters.
|
|
21
|
-
* `messages` is untyped over HTTP; callers typically send AI SDK `ModelMessage[]`.
|
|
22
|
-
*/
|
|
23
|
-
interface AiGenerateInput {
|
|
24
|
-
model?: string;
|
|
25
|
-
system?: string;
|
|
26
|
-
prompt?: string;
|
|
27
|
-
messages?: unknown[];
|
|
28
|
-
temperature?: number;
|
|
29
|
-
maxOutputTokens?: number;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* URL source from Google Search grounding.
|
|
33
|
-
* Mirrors `LanguageModelV2Source` (AI SDK `Source` type — not exported from `ai` as of v5).
|
|
34
|
-
*/
|
|
35
|
-
interface AiGenerateSource {
|
|
36
|
-
sourceType: 'url';
|
|
37
|
-
id: string;
|
|
38
|
-
url: string;
|
|
39
|
-
title?: string;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Serializable tool call. Mirrors `TypedToolCall` without generics.
|
|
43
|
-
* `input` matches the AI SDK field name (renamed from `args` in v5).
|
|
44
|
-
*/
|
|
45
|
-
interface AiGenerateToolCall {
|
|
46
|
-
type: 'tool-call';
|
|
47
|
-
toolCallId: string;
|
|
48
|
-
toolName: string;
|
|
49
|
-
input: unknown;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Serializable tool result. Mirrors `TypedToolResult` without generics.
|
|
53
|
-
* `output` matches the AI SDK field name.
|
|
54
|
-
*/
|
|
55
|
-
interface AiGenerateToolResult {
|
|
56
|
-
type: 'tool-result';
|
|
57
|
-
toolCallId: string;
|
|
58
|
-
toolName: string;
|
|
59
|
-
output: unknown;
|
|
60
|
-
isError?: boolean;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Wire-format output from `AI.generate` / `POST .../generate`.
|
|
64
|
-
* Fields mirror AI SDK `GenerateTextResult` — uses AI SDK types where exported.
|
|
65
|
-
* See https://ai-sdk.dev/docs/reference/ai-sdk-core/generate-text
|
|
66
|
-
*/
|
|
67
|
-
interface AiGenerateOutput {
|
|
68
|
-
text: string;
|
|
69
|
-
/** AI SDK `FinishReason` */
|
|
70
|
-
finishReason: FinishReason;
|
|
71
|
-
/** AI SDK `LanguageModelUsage` */
|
|
72
|
-
usage: LanguageModelUsage;
|
|
73
|
-
/** Model reasoning steps (e.g. Gemini thinking) */
|
|
74
|
-
reasoning?: ReasoningOutput[];
|
|
75
|
-
/** Concatenated reasoning text */
|
|
76
|
-
reasoningText?: string;
|
|
77
|
-
/** URL sources from Google Search grounding */
|
|
78
|
-
sources?: AiGenerateSource[];
|
|
79
|
-
/** Tool calls made during generation */
|
|
80
|
-
toolCalls?: AiGenerateToolCall[];
|
|
81
|
-
/** Tool results from generation */
|
|
82
|
-
toolResults?: AiGenerateToolResult[];
|
|
83
|
-
/** Provider warnings (e.g. unsupported settings) — AI SDK `CallWarning[]` */
|
|
84
|
-
warnings?: CallWarning[];
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Maps simplified `AI.generate(prompt, content?)` calls to wire-format input.
|
|
89
|
-
*/
|
|
90
|
-
declare function aiGenerateInputFromSimplified(prompt: string, content?: UserContent): AiGenerateInput;
|
|
91
|
-
|
|
92
|
-
export { type AiGenerateInput, type AiGenerateOutput, type AiGenerateSource, type AiGenerateToolCall, type AiGenerateToolResult, type Channel, UNSTRUCTURED_SUPPORTED_MEDIA_TYPES, aiGenerateInputFromSimplified };
|