lua-cli 2.2.8-alpha.1 → 2.3.0-alpha.1
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/API_REFERENCE.md +1408 -0
- package/CLI_REFERENCE.md +818 -0
- package/GETTING_STARTED.md +1040 -0
- package/README.md +738 -424
- package/TEMPLATE_GUIDE.md +1398 -0
- package/dist/api/agent.api.service.d.ts +45 -0
- package/dist/api/agent.api.service.js +57 -0
- package/dist/api/auth.api.service.d.ts +48 -0
- package/dist/api/auth.api.service.js +54 -0
- package/dist/api/basket.api.service.d.ts +85 -0
- package/dist/api/basket.api.service.js +164 -0
- package/dist/api/chat.api.service.d.ts +21 -0
- package/dist/api/chat.api.service.js +24 -0
- package/dist/api/credentials.d.ts +24 -0
- package/dist/api/credentials.js +46 -0
- package/dist/api/custom.data.api.service.d.ts +69 -0
- package/dist/api/custom.data.api.service.js +125 -0
- package/dist/api/lazy-instances.d.ts +49 -0
- package/dist/api/lazy-instances.js +95 -0
- package/dist/api/order.api.service.d.ts +53 -0
- package/dist/api/order.api.service.js +95 -0
- package/dist/api/products.api.service.d.ts +66 -0
- package/dist/api/products.api.service.js +112 -0
- package/dist/api/skills.api.service.d.ts +77 -0
- package/dist/api/skills.api.service.js +88 -0
- package/dist/api/tool.api.service.d.ts +52 -0
- package/dist/api/tool.api.service.js +73 -0
- package/dist/api/user.data.api.service.d.ts +33 -0
- package/dist/api/user.data.api.service.js +59 -0
- package/dist/api-exports.d.ts +271 -0
- package/dist/api-exports.js +372 -0
- package/dist/cli/command-definitions.d.ts +30 -0
- package/dist/cli/command-definitions.js +71 -0
- package/dist/commands/agents.d.ts +20 -0
- package/dist/commands/agents.js +24 -2
- package/dist/commands/apiKey.d.ts +23 -0
- package/dist/commands/apiKey.js +23 -0
- package/dist/commands/compile.d.ts +24 -0
- package/dist/commands/compile.js +67 -759
- package/dist/commands/configure.d.ts +24 -0
- package/dist/commands/configure.js +31 -96
- package/dist/commands/deploy.d.ts +31 -19
- package/dist/commands/deploy.js +45 -74
- package/dist/commands/destroy.d.ts +27 -0
- package/dist/commands/destroy.js +27 -1
- package/dist/commands/dev.d.ts +25 -62
- package/dist/commands/dev.js +58 -873
- package/dist/commands/init.d.ts +27 -0
- package/dist/commands/init.js +98 -260
- package/dist/commands/push.d.ts +24 -21
- package/dist/commands/push.js +39 -92
- package/dist/commands/test.d.ts +26 -0
- package/dist/commands/test.js +41 -188
- package/dist/common/basket.instance.d.ts +78 -0
- package/dist/common/basket.instance.js +132 -0
- package/dist/common/data.entry.instance.d.ts +39 -0
- package/dist/common/data.entry.instance.js +76 -0
- package/dist/common/http.client.d.ts +64 -0
- package/dist/common/http.client.js +133 -0
- package/dist/common/order.instance.d.ts +40 -0
- package/dist/common/order.instance.js +79 -0
- package/dist/common/product.instance.d.ts +33 -0
- package/dist/common/product.instance.js +63 -0
- package/dist/common/product.pagination.instance.d.ts +43 -0
- package/dist/common/product.pagination.instance.js +74 -0
- package/dist/common/product.search.instance.d.ts +22 -0
- package/dist/common/product.search.instance.js +40 -0
- package/dist/common/user.instance.d.ts +41 -0
- package/dist/common/user.instance.js +84 -0
- package/dist/config/auth.constants.d.ts +11 -0
- package/dist/config/auth.constants.js +11 -0
- package/dist/config/compile.constants.d.ts +67 -0
- package/dist/config/compile.constants.js +99 -0
- package/dist/config/constants.d.ts +5 -0
- package/dist/config/constants.js +5 -0
- package/dist/config/dev.constants.d.ts +65 -0
- package/dist/config/dev.constants.js +79 -0
- package/dist/config/init.constants.d.ts +23 -0
- package/dist/config/init.constants.js +41 -0
- package/dist/index.d.ts +19 -3
- package/dist/index.js +28 -44
- package/dist/interfaces/admin.d.ts +101 -0
- package/dist/interfaces/admin.js +5 -0
- package/dist/interfaces/agent.d.ts +107 -0
- package/dist/interfaces/agent.js +5 -0
- package/dist/interfaces/baskets.d.ts +135 -0
- package/dist/interfaces/baskets.js +19 -0
- package/dist/interfaces/chat.d.ts +61 -0
- package/dist/interfaces/chat.js +5 -0
- package/dist/interfaces/common.d.ts +62 -0
- package/dist/interfaces/common.js +8 -0
- package/dist/interfaces/compile.d.ts +11 -0
- package/dist/interfaces/compile.js +4 -0
- package/dist/interfaces/custom.data.d.ts +82 -0
- package/dist/interfaces/custom.data.js +5 -0
- package/dist/interfaces/deploy.d.ts +29 -0
- package/dist/interfaces/deploy.js +4 -0
- package/dist/interfaces/dev.d.ts +53 -0
- package/dist/interfaces/dev.js +5 -0
- package/dist/interfaces/init.d.ts +60 -0
- package/dist/interfaces/init.js +4 -0
- package/dist/interfaces/orders.d.ts +91 -0
- package/dist/interfaces/orders.js +19 -0
- package/dist/interfaces/product.d.ts +65 -0
- package/dist/interfaces/product.js +5 -0
- package/dist/interfaces/push.d.ts +26 -0
- package/dist/interfaces/push.js +4 -0
- package/dist/interfaces/test.d.ts +36 -0
- package/dist/interfaces/test.js +4 -0
- package/dist/services/auth.d.ts +54 -99
- package/dist/services/auth.js +76 -12
- package/dist/types/api-contracts.d.ts +211 -0
- package/dist/types/api-contracts.js +8 -0
- package/dist/types/compile.types.d.ts +76 -0
- package/dist/types/compile.types.js +4 -0
- package/dist/types/index.d.ts +23 -85
- package/dist/types/index.js +25 -14
- package/dist/types/skill.d.ts +142 -0
- package/dist/{skill.js → types/skill.js} +66 -19
- package/dist/types/tool-validation.d.ts +34 -0
- package/dist/types/tool-validation.js +42 -0
- package/dist/utils/auth-flows.d.ts +26 -0
- package/dist/utils/auth-flows.js +141 -0
- package/dist/utils/bundling.d.ts +36 -0
- package/dist/utils/bundling.js +137 -0
- package/dist/utils/compile.d.ts +37 -0
- package/dist/utils/compile.js +242 -0
- package/dist/utils/deploy-api.d.ts +26 -0
- package/dist/utils/deploy-api.js +53 -0
- package/dist/utils/deploy-helpers.d.ts +46 -0
- package/dist/utils/deploy-helpers.js +86 -0
- package/dist/utils/deployment.d.ts +25 -0
- package/dist/utils/deployment.js +161 -0
- package/dist/utils/dev-api.d.ts +61 -0
- package/dist/utils/dev-api.js +262 -0
- package/dist/utils/dev-helpers.d.ts +46 -0
- package/dist/utils/dev-helpers.js +83 -0
- package/dist/utils/dev-server.d.ts +24 -0
- package/dist/utils/dev-server.js +555 -0
- package/dist/utils/dev-watcher.d.ts +31 -0
- package/dist/utils/dev-watcher.js +110 -0
- package/dist/utils/files.js +0 -5
- package/dist/utils/init-agent.d.ts +34 -0
- package/dist/utils/init-agent.js +129 -0
- package/dist/utils/init-helpers.d.ts +41 -0
- package/dist/utils/init-helpers.js +73 -0
- package/dist/utils/init-prompts.d.ts +47 -0
- package/dist/utils/init-prompts.js +168 -0
- package/dist/utils/push-api.d.ts +15 -0
- package/dist/utils/push-api.js +48 -0
- package/dist/utils/push-helpers.d.ts +38 -0
- package/dist/utils/push-helpers.js +84 -0
- package/dist/utils/sandbox-storage.d.ts +27 -0
- package/dist/utils/sandbox-storage.js +71 -0
- package/dist/utils/sandbox.js +78 -118
- package/dist/utils/skill-management.d.ts +14 -0
- package/dist/utils/skill-management.js +148 -0
- package/dist/utils/test-helpers.d.ts +40 -0
- package/dist/utils/test-helpers.js +92 -0
- package/dist/utils/test-prompts.d.ts +23 -0
- package/dist/utils/test-prompts.js +186 -0
- package/dist/utils/tool-detection.d.ts +18 -0
- package/dist/utils/tool-detection.js +110 -0
- package/dist/web/app.css +14 -9
- package/package.json +11 -12
- package/template/QUICKSTART.md +299 -144
- package/template/README.md +928 -349
- package/template/TOOL_EXAMPLES.md +655 -0
- package/template/package-lock.json +3781 -0
- package/template/package.json +1 -1
- package/template/src/index.ts +81 -40
- package/template/src/tools/BasketTool.ts +128 -0
- package/template/src/tools/CustomDataTool.ts +7 -13
- package/template/src/tools/OrderTool.ts +54 -0
- package/template/src/tools/PaymentTool.ts +1 -1
- package/template/src/tools/ProductsTool.ts +56 -118
- package/template/src/tools/UserDataTool.ts +4 -27
- package/dist/custom-data-api.d.ts +0 -72
- package/dist/custom-data-api.js +0 -174
- package/dist/product-api.d.ts +0 -197
- package/dist/product-api.js +0 -152
- package/dist/services/api.d.ts +0 -569
- package/dist/services/api.js +0 -625
- package/dist/skill.d.ts +0 -50
- package/dist/types.d.ts +0 -1
- package/dist/types.js +0 -2
- package/dist/user-data-api.d.ts +0 -39
- package/dist/user-data-api.js +0 -50
- package/template/API.md +0 -604
- package/template/DEVELOPER.md +0 -771
- package/template/lua.skill.yaml +0 -16
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants for the compile command
|
|
3
|
+
*/
|
|
4
|
+
import { BuildOptions } from "esbuild";
|
|
5
|
+
/**
|
|
6
|
+
* Directory names used during compilation
|
|
7
|
+
*/
|
|
8
|
+
export declare const COMPILE_DIRS: {
|
|
9
|
+
readonly DIST: "dist";
|
|
10
|
+
readonly LUA: ".lua";
|
|
11
|
+
readonly TOOLS: "tools";
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* File names used during compilation
|
|
15
|
+
*/
|
|
16
|
+
export declare const COMPILE_FILES: {
|
|
17
|
+
readonly DEPLOYMENT_JSON: "deployment.json";
|
|
18
|
+
readonly DEPLOY_JSON: "deploy.json";
|
|
19
|
+
readonly INDEX_TS: "index.ts";
|
|
20
|
+
readonly INDEX_JS: "index.js";
|
|
21
|
+
readonly PACKAGE_JSON: "package.json";
|
|
22
|
+
readonly TSCONFIG_JSON: "tsconfig.json";
|
|
23
|
+
readonly LUA_SKILL_YAML: "lua.skill.yaml";
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Default values for skill metadata
|
|
27
|
+
*/
|
|
28
|
+
export declare const SKILL_DEFAULTS: {
|
|
29
|
+
readonly NAME: "lua-skill";
|
|
30
|
+
readonly VERSION: "1.0.0";
|
|
31
|
+
readonly DESCRIPTION: "";
|
|
32
|
+
readonly CONTEXT: "";
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* External packages that should not be bundled with tools
|
|
36
|
+
* These are either lua-cli modules, native modules, or modules
|
|
37
|
+
* that should be provided by the runtime environment
|
|
38
|
+
*/
|
|
39
|
+
export declare const EXTERNAL_PACKAGES: readonly ["lua-cli/skill", "lua-cli", "lua-cli/user-data-api", "lua-cli/product-api", "lua-cli/custom-data-api", "zod", "keytar", "esbuild", "commander", "inquirer", "node-fetch", "ws", "socket.io-client", "ts-morph"];
|
|
40
|
+
/**
|
|
41
|
+
* Common esbuild configuration for tool bundling
|
|
42
|
+
*/
|
|
43
|
+
export declare const ESBUILD_TOOL_CONFIG: Partial<BuildOptions>;
|
|
44
|
+
/**
|
|
45
|
+
* Common esbuild configuration for main index bundling
|
|
46
|
+
*/
|
|
47
|
+
export declare const ESBUILD_INDEX_CONFIG: Partial<BuildOptions>;
|
|
48
|
+
/**
|
|
49
|
+
* Default input schema for tools without explicit schema
|
|
50
|
+
*/
|
|
51
|
+
export declare const DEFAULT_INPUT_SCHEMA: {
|
|
52
|
+
readonly type: "object";
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* JSON formatting options
|
|
56
|
+
*/
|
|
57
|
+
export declare const JSON_FORMAT: {
|
|
58
|
+
readonly INDENT: 2;
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* YAML formatting options
|
|
62
|
+
*/
|
|
63
|
+
export declare const YAML_FORMAT: {
|
|
64
|
+
readonly INDENT: 2;
|
|
65
|
+
readonly LINE_WIDTH: -1;
|
|
66
|
+
readonly NO_REFS: true;
|
|
67
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants for the compile command
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Directory names used during compilation
|
|
6
|
+
*/
|
|
7
|
+
export const COMPILE_DIRS = {
|
|
8
|
+
DIST: 'dist',
|
|
9
|
+
LUA: '.lua',
|
|
10
|
+
TOOLS: 'tools',
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* File names used during compilation
|
|
14
|
+
*/
|
|
15
|
+
export const COMPILE_FILES = {
|
|
16
|
+
DEPLOYMENT_JSON: 'deployment.json',
|
|
17
|
+
DEPLOY_JSON: 'deploy.json',
|
|
18
|
+
INDEX_TS: 'index.ts',
|
|
19
|
+
INDEX_JS: 'index.js',
|
|
20
|
+
PACKAGE_JSON: 'package.json',
|
|
21
|
+
TSCONFIG_JSON: 'tsconfig.json',
|
|
22
|
+
LUA_SKILL_YAML: 'lua.skill.yaml',
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Default values for skill metadata
|
|
26
|
+
*/
|
|
27
|
+
export const SKILL_DEFAULTS = {
|
|
28
|
+
NAME: 'lua-skill',
|
|
29
|
+
VERSION: '1.0.0',
|
|
30
|
+
DESCRIPTION: '',
|
|
31
|
+
CONTEXT: '',
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* External packages that should not be bundled with tools
|
|
35
|
+
* These are either lua-cli modules, native modules, or modules
|
|
36
|
+
* that should be provided by the runtime environment
|
|
37
|
+
*/
|
|
38
|
+
export const EXTERNAL_PACKAGES = [
|
|
39
|
+
'lua-cli/skill',
|
|
40
|
+
'lua-cli',
|
|
41
|
+
'lua-cli/user-data-api',
|
|
42
|
+
'lua-cli/product-api',
|
|
43
|
+
'lua-cli/custom-data-api',
|
|
44
|
+
'zod',
|
|
45
|
+
'keytar',
|
|
46
|
+
'esbuild',
|
|
47
|
+
'commander',
|
|
48
|
+
'inquirer',
|
|
49
|
+
'node-fetch',
|
|
50
|
+
'ws',
|
|
51
|
+
'socket.io-client',
|
|
52
|
+
'ts-morph',
|
|
53
|
+
];
|
|
54
|
+
/**
|
|
55
|
+
* Common esbuild configuration for tool bundling
|
|
56
|
+
*/
|
|
57
|
+
export const ESBUILD_TOOL_CONFIG = {
|
|
58
|
+
bundle: true,
|
|
59
|
+
format: 'cjs',
|
|
60
|
+
platform: 'node',
|
|
61
|
+
target: 'node16',
|
|
62
|
+
external: [...EXTERNAL_PACKAGES],
|
|
63
|
+
minify: true,
|
|
64
|
+
sourcemap: false,
|
|
65
|
+
resolveExtensions: ['.ts', '.js', '.json'],
|
|
66
|
+
define: {
|
|
67
|
+
'process.env.NODE_ENV': '"production"'
|
|
68
|
+
},
|
|
69
|
+
packages: 'bundle',
|
|
70
|
+
mainFields: ['main', 'module'],
|
|
71
|
+
conditions: ['node']
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Common esbuild configuration for main index bundling
|
|
75
|
+
*/
|
|
76
|
+
export const ESBUILD_INDEX_CONFIG = {
|
|
77
|
+
...ESBUILD_TOOL_CONFIG,
|
|
78
|
+
external: [...EXTERNAL_PACKAGES],
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* Default input schema for tools without explicit schema
|
|
82
|
+
*/
|
|
83
|
+
export const DEFAULT_INPUT_SCHEMA = {
|
|
84
|
+
type: 'object'
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* JSON formatting options
|
|
88
|
+
*/
|
|
89
|
+
export const JSON_FORMAT = {
|
|
90
|
+
INDENT: 2,
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* YAML formatting options
|
|
94
|
+
*/
|
|
95
|
+
export const YAML_FORMAT = {
|
|
96
|
+
INDENT: 2,
|
|
97
|
+
LINE_WIDTH: -1,
|
|
98
|
+
NO_REFS: true,
|
|
99
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants for the dev command
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Sandbox skill ID storage identifiers for keytar
|
|
6
|
+
*/
|
|
7
|
+
export declare const SANDBOX_STORAGE: {
|
|
8
|
+
readonly SERVICE: "lua-cli-sandbox";
|
|
9
|
+
readonly ACCOUNT: "sandbox-skill-id";
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Default port for dev server
|
|
13
|
+
*/
|
|
14
|
+
export declare const DEV_SERVER_PORT = 3000;
|
|
15
|
+
/**
|
|
16
|
+
* File watching configuration
|
|
17
|
+
*/
|
|
18
|
+
export declare const FILE_WATCH_CONFIG: {
|
|
19
|
+
readonly DEBOUNCE_DELAY: 500;
|
|
20
|
+
readonly RECURSIVE: true;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Paths to ignore during file watching
|
|
24
|
+
*/
|
|
25
|
+
export declare const WATCH_IGNORE_PATTERNS: readonly [".lua/", ".lua\\", "node_modules/", "node_modules\\", ".git/", ".git\\", "dist/", "dist\\"];
|
|
26
|
+
/**
|
|
27
|
+
* File extensions to ignore during watching
|
|
28
|
+
*/
|
|
29
|
+
export declare const WATCH_IGNORE_EXTENSIONS: readonly [".log", ".tmp", ".js", ".map"];
|
|
30
|
+
/**
|
|
31
|
+
* WebSocket message types
|
|
32
|
+
*/
|
|
33
|
+
export declare const WS_MESSAGE_TYPES: {
|
|
34
|
+
readonly LOG: "log";
|
|
35
|
+
readonly INFO: "info";
|
|
36
|
+
readonly WARN: "warn";
|
|
37
|
+
readonly ERROR: "error";
|
|
38
|
+
readonly DEBUG: "debug";
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* HTTP response codes
|
|
42
|
+
*/
|
|
43
|
+
export declare const HTTP_STATUS: {
|
|
44
|
+
readonly OK: 200;
|
|
45
|
+
readonly NOT_FOUND: 404;
|
|
46
|
+
readonly SERVER_ERROR: 500;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* CORS headers
|
|
50
|
+
*/
|
|
51
|
+
export declare const CORS_HEADERS: {
|
|
52
|
+
readonly 'Access-Control-Allow-Origin': "*";
|
|
53
|
+
readonly 'Access-Control-Allow-Methods': "GET, POST, OPTIONS";
|
|
54
|
+
readonly 'Access-Control-Allow-Headers': "Content-Type";
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Default skill configuration values
|
|
58
|
+
*/
|
|
59
|
+
export declare const DEV_DEFAULTS: {
|
|
60
|
+
readonly VERSION: "1.0.0";
|
|
61
|
+
readonly SKILL_NAME: "Unknown Skill";
|
|
62
|
+
readonly DESCRIPTION: "A Lua skill for AI automation";
|
|
63
|
+
readonly NOT_COMPILED_DESCRIPTION: "A Lua skill for AI automation (not compiled)";
|
|
64
|
+
readonly NOT_COMPILED_CONTEXT: "This skill has not been compiled yet. Run \"lua compile\" to see full context information.";
|
|
65
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants for the dev command
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Sandbox skill ID storage identifiers for keytar
|
|
6
|
+
*/
|
|
7
|
+
export const SANDBOX_STORAGE = {
|
|
8
|
+
SERVICE: 'lua-cli-sandbox',
|
|
9
|
+
ACCOUNT: 'sandbox-skill-id',
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Default port for dev server
|
|
13
|
+
*/
|
|
14
|
+
export const DEV_SERVER_PORT = 3000;
|
|
15
|
+
/**
|
|
16
|
+
* File watching configuration
|
|
17
|
+
*/
|
|
18
|
+
export const FILE_WATCH_CONFIG = {
|
|
19
|
+
DEBOUNCE_DELAY: 500, // milliseconds
|
|
20
|
+
RECURSIVE: true,
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Paths to ignore during file watching
|
|
24
|
+
*/
|
|
25
|
+
export const WATCH_IGNORE_PATTERNS = [
|
|
26
|
+
'.lua/',
|
|
27
|
+
'.lua\\',
|
|
28
|
+
'node_modules/',
|
|
29
|
+
'node_modules\\',
|
|
30
|
+
'.git/',
|
|
31
|
+
'.git\\',
|
|
32
|
+
'dist/',
|
|
33
|
+
'dist\\',
|
|
34
|
+
];
|
|
35
|
+
/**
|
|
36
|
+
* File extensions to ignore during watching
|
|
37
|
+
*/
|
|
38
|
+
export const WATCH_IGNORE_EXTENSIONS = [
|
|
39
|
+
'.log',
|
|
40
|
+
'.tmp',
|
|
41
|
+
'.js',
|
|
42
|
+
'.map',
|
|
43
|
+
];
|
|
44
|
+
/**
|
|
45
|
+
* WebSocket message types
|
|
46
|
+
*/
|
|
47
|
+
export const WS_MESSAGE_TYPES = {
|
|
48
|
+
LOG: 'log',
|
|
49
|
+
INFO: 'info',
|
|
50
|
+
WARN: 'warn',
|
|
51
|
+
ERROR: 'error',
|
|
52
|
+
DEBUG: 'debug',
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* HTTP response codes
|
|
56
|
+
*/
|
|
57
|
+
export const HTTP_STATUS = {
|
|
58
|
+
OK: 200,
|
|
59
|
+
NOT_FOUND: 404,
|
|
60
|
+
SERVER_ERROR: 500,
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* CORS headers
|
|
64
|
+
*/
|
|
65
|
+
export const CORS_HEADERS = {
|
|
66
|
+
'Access-Control-Allow-Origin': '*',
|
|
67
|
+
'Access-Control-Allow-Methods': 'GET, POST, OPTIONS',
|
|
68
|
+
'Access-Control-Allow-Headers': 'Content-Type',
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Default skill configuration values
|
|
72
|
+
*/
|
|
73
|
+
export const DEV_DEFAULTS = {
|
|
74
|
+
VERSION: '1.0.0',
|
|
75
|
+
SKILL_NAME: 'Unknown Skill',
|
|
76
|
+
DESCRIPTION: 'A Lua skill for AI automation',
|
|
77
|
+
NOT_COMPILED_DESCRIPTION: 'A Lua skill for AI automation (not compiled)',
|
|
78
|
+
NOT_COMPILED_CONTEXT: 'This skill has not been compiled yet. Run "lua compile" to see full context information.',
|
|
79
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants for the init command
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Wait time for agent to be ready after creation (in milliseconds)
|
|
6
|
+
*/
|
|
7
|
+
export declare const AGENT_READY_WAIT_TIME = 30000;
|
|
8
|
+
/**
|
|
9
|
+
* Business type options for agent creation
|
|
10
|
+
*/
|
|
11
|
+
export declare const BUSINESS_TYPES: readonly ["Retail & Consumer Goods (e.g. clothing store, bookstore)", "Food & Beverage (e.g. restaurant, bakery)", "Hospitality (e.g. hotel, resort)", "Personal services (e.g. hair salon, spa)", "Education (e.g. language school, online courses)", "Health (e.g. gym, yoga studio, clinic)"];
|
|
12
|
+
/**
|
|
13
|
+
* Brand personality options for agent creation
|
|
14
|
+
*/
|
|
15
|
+
export declare const BRAND_PERSONALITIES: readonly ["Energetic & fun", "Refined & elegant", "Chatty", "Casual", "Funny", "Friendly"];
|
|
16
|
+
/**
|
|
17
|
+
* Default business name
|
|
18
|
+
*/
|
|
19
|
+
export declare const DEFAULT_BUSINESS_NAME = "Private";
|
|
20
|
+
/**
|
|
21
|
+
* Agent type names to search for (in order of preference)
|
|
22
|
+
*/
|
|
23
|
+
export declare const PREFERRED_AGENT_TYPES: readonly ["Base Agent", "baseAgent", "base"];
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants for the init command
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Wait time for agent to be ready after creation (in milliseconds)
|
|
6
|
+
*/
|
|
7
|
+
export const AGENT_READY_WAIT_TIME = 30000; // 30 seconds
|
|
8
|
+
/**
|
|
9
|
+
* Business type options for agent creation
|
|
10
|
+
*/
|
|
11
|
+
export const BUSINESS_TYPES = [
|
|
12
|
+
"Retail & Consumer Goods (e.g. clothing store, bookstore)",
|
|
13
|
+
"Food & Beverage (e.g. restaurant, bakery)",
|
|
14
|
+
"Hospitality (e.g. hotel, resort)",
|
|
15
|
+
"Personal services (e.g. hair salon, spa)",
|
|
16
|
+
"Education (e.g. language school, online courses)",
|
|
17
|
+
"Health (e.g. gym, yoga studio, clinic)"
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* Brand personality options for agent creation
|
|
21
|
+
*/
|
|
22
|
+
export const BRAND_PERSONALITIES = [
|
|
23
|
+
"Energetic & fun",
|
|
24
|
+
"Refined & elegant",
|
|
25
|
+
"Chatty",
|
|
26
|
+
"Casual",
|
|
27
|
+
"Funny",
|
|
28
|
+
"Friendly"
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* Default business name
|
|
32
|
+
*/
|
|
33
|
+
export const DEFAULT_BUSINESS_NAME = "Private";
|
|
34
|
+
/**
|
|
35
|
+
* Agent type names to search for (in order of preference)
|
|
36
|
+
*/
|
|
37
|
+
export const PREFERRED_AGENT_TYPES = [
|
|
38
|
+
'Base Agent',
|
|
39
|
+
'baseAgent',
|
|
40
|
+
'base'
|
|
41
|
+
];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Lua CLI - Main Entry Point
|
|
4
|
+
*
|
|
5
|
+
* Command-line interface for managing Lua AI skills.
|
|
6
|
+
* Provides tools for authentication, project initialization, compilation,
|
|
7
|
+
* testing, deployment, and development.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* lua auth configure # Set up authentication
|
|
11
|
+
* lua init # Initialize new project
|
|
12
|
+
* lua compile # Compile skill
|
|
13
|
+
* lua test # Test tools
|
|
14
|
+
* lua push # Push to server
|
|
15
|
+
* lua deploy # Deploy to production
|
|
16
|
+
* lua dev # Start development mode
|
|
17
|
+
*
|
|
18
|
+
* For more information: https://docs.lua.ai
|
|
19
|
+
*/
|
|
20
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -1,49 +1,33 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Lua CLI - Main Entry Point
|
|
4
|
+
*
|
|
5
|
+
* Command-line interface for managing Lua AI skills.
|
|
6
|
+
* Provides tools for authentication, project initialization, compilation,
|
|
7
|
+
* testing, deployment, and development.
|
|
8
|
+
*
|
|
9
|
+
* Usage:
|
|
10
|
+
* lua auth configure # Set up authentication
|
|
11
|
+
* lua init # Initialize new project
|
|
12
|
+
* lua compile # Compile skill
|
|
13
|
+
* lua test # Test tools
|
|
14
|
+
* lua push # Push to server
|
|
15
|
+
* lua deploy # Deploy to production
|
|
16
|
+
* lua dev # Start development mode
|
|
17
|
+
*
|
|
18
|
+
* For more information: https://docs.lua.ai
|
|
19
|
+
*/
|
|
2
20
|
import { Command } from "commander";
|
|
3
|
-
import {
|
|
21
|
+
import { setupAuthCommands, setupSkillCommands } from "./cli/command-definitions.js";
|
|
22
|
+
// Create the main CLI program
|
|
4
23
|
const program = new Command();
|
|
5
|
-
|
|
6
|
-
.command("auth")
|
|
7
|
-
.description("Authentication management commands");
|
|
8
|
-
authCommand
|
|
9
|
-
.command("configure")
|
|
10
|
-
.description("Set up your API key")
|
|
11
|
-
.action(configureCommand);
|
|
12
|
-
authCommand
|
|
13
|
-
.command("logout")
|
|
14
|
-
.description("Delete your stored API key")
|
|
15
|
-
.action(destroyCommand);
|
|
16
|
-
authCommand
|
|
17
|
-
.command("key")
|
|
18
|
-
.description("Display your stored API key")
|
|
19
|
-
.action(apiKeyCommand);
|
|
20
|
-
// Skill management commands (moved to top level)
|
|
24
|
+
// Configure program metadata
|
|
21
25
|
program
|
|
22
|
-
.
|
|
23
|
-
.description("
|
|
24
|
-
.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
program
|
|
30
|
-
.command("test")
|
|
31
|
-
.description("Test Lua skill tools interactively")
|
|
32
|
-
.action(testCommand);
|
|
33
|
-
program
|
|
34
|
-
.command("push")
|
|
35
|
-
.description("Push compiled skill version to server")
|
|
36
|
-
.action(pushCommand);
|
|
37
|
-
program
|
|
38
|
-
.command("deploy")
|
|
39
|
-
.description("Deploy a version to production")
|
|
40
|
-
.action(deployCommand);
|
|
41
|
-
program
|
|
42
|
-
.command("dev")
|
|
43
|
-
.description("Push compiled skill version to sandbox for development")
|
|
44
|
-
.action(devCommand);
|
|
26
|
+
.name("lua")
|
|
27
|
+
.description("Lua AI Skill Management CLI")
|
|
28
|
+
.version("2.3.0-alpha.1");
|
|
29
|
+
// Set up all command groups
|
|
30
|
+
setupAuthCommands(program);
|
|
31
|
+
setupSkillCommands(program);
|
|
32
|
+
// Parse command-line arguments
|
|
45
33
|
program.parse(process.argv);
|
|
46
|
-
// Export user data API for use in projects
|
|
47
|
-
export { user, UserDataAPI } from './user-data-api.js';
|
|
48
|
-
export { product, ProductAPI } from './product-api.js';
|
|
49
|
-
export { customData, CustomDataAPI } from './custom-data-api.js';
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Admin & User Interfaces
|
|
3
|
+
* User data, authentication, and administrative structures
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* User data from authentication
|
|
7
|
+
*/
|
|
8
|
+
export interface UserData {
|
|
9
|
+
uid: string;
|
|
10
|
+
email: string;
|
|
11
|
+
emailVerified: boolean;
|
|
12
|
+
fullName: string;
|
|
13
|
+
mobileNumbers: any[];
|
|
14
|
+
emailAddresses: EmailAddress[];
|
|
15
|
+
country: any;
|
|
16
|
+
admin: Admin;
|
|
17
|
+
channels: Record<string, any>;
|
|
18
|
+
rights: Record<string, any>;
|
|
19
|
+
setupPersona: Record<string, any>;
|
|
20
|
+
notifications: Record<string, any>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Email address with validation status
|
|
24
|
+
*/
|
|
25
|
+
export interface EmailAddress {
|
|
26
|
+
address: string;
|
|
27
|
+
validated: boolean;
|
|
28
|
+
validatedAt: number;
|
|
29
|
+
_id: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Country information
|
|
33
|
+
*/
|
|
34
|
+
export interface Country {
|
|
35
|
+
code: string;
|
|
36
|
+
name: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Admin privileges and organization access
|
|
40
|
+
*/
|
|
41
|
+
export interface Admin {
|
|
42
|
+
userId: string;
|
|
43
|
+
orgs: OrganizationAuth[];
|
|
44
|
+
id: string;
|
|
45
|
+
createdAt: number;
|
|
46
|
+
__v: number;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Organization with authentication context.
|
|
50
|
+
* Includes agents and permissions for the authenticated user.
|
|
51
|
+
*/
|
|
52
|
+
export interface OrganizationAuth {
|
|
53
|
+
id: string;
|
|
54
|
+
rights?: string[];
|
|
55
|
+
agents: AgentAuth[];
|
|
56
|
+
registeredName: string;
|
|
57
|
+
country: string;
|
|
58
|
+
phoneNumber?: string | null;
|
|
59
|
+
type: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Agent with user-specific authentication context.
|
|
63
|
+
* This is different from the Agent interface in agent.ts which represents
|
|
64
|
+
* the full agent entity.
|
|
65
|
+
*/
|
|
66
|
+
export interface AgentAuth {
|
|
67
|
+
agentId: string;
|
|
68
|
+
rights: string[];
|
|
69
|
+
name: string;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Basic organization structure
|
|
73
|
+
*/
|
|
74
|
+
export interface Organization {
|
|
75
|
+
id: string;
|
|
76
|
+
name: string;
|
|
77
|
+
agents: string[];
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Skill version information
|
|
81
|
+
*/
|
|
82
|
+
export interface SkillVersion {
|
|
83
|
+
version: string;
|
|
84
|
+
createdAt: string;
|
|
85
|
+
status: string;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* OTP verification response
|
|
89
|
+
*/
|
|
90
|
+
export interface OTPResponse {
|
|
91
|
+
signInToken: string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* API key generation response
|
|
95
|
+
*/
|
|
96
|
+
export interface ApiKeyResponse {
|
|
97
|
+
message: string;
|
|
98
|
+
userId: string;
|
|
99
|
+
apiKey: string;
|
|
100
|
+
apiId: string;
|
|
101
|
+
}
|