lua-cli 2.2.8-alpha.2 → 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.
Files changed (193) hide show
  1. package/API_REFERENCE.md +1408 -0
  2. package/CLI_REFERENCE.md +818 -0
  3. package/GETTING_STARTED.md +1040 -0
  4. package/README.md +738 -424
  5. package/TEMPLATE_GUIDE.md +1398 -0
  6. package/dist/api/agent.api.service.d.ts +33 -6
  7. package/dist/api/agent.api.service.js +27 -0
  8. package/dist/api/auth.api.service.d.ts +31 -2
  9. package/dist/api/auth.api.service.js +29 -0
  10. package/dist/api/basket.api.service.d.ts +53 -11
  11. package/dist/api/basket.api.service.js +63 -14
  12. package/dist/api/chat.api.service.d.ts +15 -3
  13. package/dist/api/chat.api.service.js +12 -0
  14. package/dist/api/credentials.d.ts +24 -0
  15. package/dist/api/credentials.js +46 -0
  16. package/dist/api/custom.data.api.service.d.ts +45 -9
  17. package/dist/api/custom.data.api.service.js +43 -9
  18. package/dist/api/lazy-instances.d.ts +49 -0
  19. package/dist/api/lazy-instances.js +95 -0
  20. package/dist/api/order.api.service.d.ts +34 -4
  21. package/dist/api/order.api.service.js +41 -3
  22. package/dist/api/products.api.service.d.ts +39 -9
  23. package/dist/api/products.api.service.js +43 -5
  24. package/dist/api/skills.api.service.d.ts +49 -2
  25. package/dist/api/skills.api.service.js +47 -1
  26. package/dist/api/tool.api.service.d.ts +39 -1
  27. package/dist/api/tool.api.service.js +38 -0
  28. package/dist/api/user.data.api.service.d.ts +23 -1
  29. package/dist/api/user.data.api.service.js +22 -0
  30. package/dist/api-exports.d.ts +236 -5
  31. package/dist/api-exports.js +264 -81
  32. package/dist/cli/command-definitions.d.ts +30 -0
  33. package/dist/cli/command-definitions.js +71 -0
  34. package/dist/commands/agents.d.ts +20 -0
  35. package/dist/commands/agents.js +24 -2
  36. package/dist/commands/apiKey.d.ts +23 -0
  37. package/dist/commands/apiKey.js +23 -0
  38. package/dist/commands/compile.d.ts +24 -0
  39. package/dist/commands/compile.js +67 -759
  40. package/dist/commands/configure.d.ts +24 -0
  41. package/dist/commands/configure.js +31 -96
  42. package/dist/commands/deploy.d.ts +31 -19
  43. package/dist/commands/deploy.js +45 -74
  44. package/dist/commands/destroy.d.ts +27 -0
  45. package/dist/commands/destroy.js +27 -1
  46. package/dist/commands/dev.d.ts +25 -62
  47. package/dist/commands/dev.js +58 -878
  48. package/dist/commands/init.d.ts +27 -0
  49. package/dist/commands/init.js +98 -260
  50. package/dist/commands/push.d.ts +24 -21
  51. package/dist/commands/push.js +39 -92
  52. package/dist/commands/test.d.ts +26 -0
  53. package/dist/commands/test.js +41 -188
  54. package/dist/common/basket.instance.d.ts +54 -3
  55. package/dist/common/basket.instance.js +56 -3
  56. package/dist/common/data.entry.instance.d.ts +25 -2
  57. package/dist/common/data.entry.instance.js +24 -0
  58. package/dist/common/http.client.d.ts +51 -1
  59. package/dist/common/http.client.js +50 -0
  60. package/dist/common/order.instance.d.ts +22 -0
  61. package/dist/common/order.instance.js +31 -4
  62. package/dist/common/product.instance.d.ts +22 -1
  63. package/dist/common/product.instance.js +24 -6
  64. package/dist/common/product.pagination.instance.d.ts +22 -2
  65. package/dist/common/product.pagination.instance.js +22 -1
  66. package/dist/common/product.search.instance.d.ts +13 -3
  67. package/dist/common/product.search.instance.js +12 -1
  68. package/dist/common/user.instance.d.ts +27 -3
  69. package/dist/common/user.instance.js +28 -7
  70. package/dist/config/auth.constants.d.ts +11 -0
  71. package/dist/config/auth.constants.js +11 -0
  72. package/dist/config/compile.constants.d.ts +67 -0
  73. package/dist/config/compile.constants.js +99 -0
  74. package/dist/config/constants.d.ts +5 -0
  75. package/dist/config/constants.js +5 -0
  76. package/dist/config/dev.constants.d.ts +65 -0
  77. package/dist/config/dev.constants.js +79 -0
  78. package/dist/config/init.constants.d.ts +23 -0
  79. package/dist/config/init.constants.js +41 -0
  80. package/dist/index.d.ts +19 -3
  81. package/dist/index.js +28 -44
  82. package/dist/interfaces/admin.d.ts +56 -50
  83. package/dist/interfaces/admin.js +4 -0
  84. package/dist/interfaces/agent.d.ts +21 -0
  85. package/dist/interfaces/agent.js +4 -0
  86. package/dist/interfaces/baskets.d.ts +60 -0
  87. package/dist/interfaces/baskets.js +12 -0
  88. package/dist/interfaces/chat.d.ts +48 -4
  89. package/dist/interfaces/chat.js +4 -0
  90. package/dist/interfaces/common.d.ts +62 -0
  91. package/dist/interfaces/common.js +8 -0
  92. package/dist/interfaces/compile.d.ts +11 -0
  93. package/dist/interfaces/compile.js +4 -0
  94. package/dist/interfaces/custom.data.d.ts +49 -19
  95. package/dist/interfaces/custom.data.js +4 -0
  96. package/dist/interfaces/deploy.d.ts +29 -0
  97. package/dist/interfaces/deploy.js +4 -0
  98. package/dist/interfaces/dev.d.ts +53 -0
  99. package/dist/interfaces/dev.js +5 -0
  100. package/dist/interfaces/init.d.ts +60 -0
  101. package/dist/interfaces/init.js +4 -0
  102. package/dist/interfaces/orders.d.ts +37 -0
  103. package/dist/interfaces/orders.js +12 -0
  104. package/dist/interfaces/product.d.ts +38 -10
  105. package/dist/interfaces/product.js +4 -0
  106. package/dist/interfaces/push.d.ts +26 -0
  107. package/dist/interfaces/push.js +4 -0
  108. package/dist/interfaces/test.d.ts +36 -0
  109. package/dist/interfaces/test.js +4 -0
  110. package/dist/services/auth.d.ts +54 -99
  111. package/dist/services/auth.js +76 -12
  112. package/dist/types/api-contracts.d.ts +211 -0
  113. package/dist/types/api-contracts.js +8 -0
  114. package/dist/types/compile.types.d.ts +76 -0
  115. package/dist/types/compile.types.js +4 -0
  116. package/dist/types/index.d.ts +23 -121
  117. package/dist/types/index.js +25 -14
  118. package/dist/types/skill.d.ts +142 -0
  119. package/dist/{skill.js → types/skill.js} +66 -17
  120. package/dist/types/tool-validation.d.ts +34 -0
  121. package/dist/types/tool-validation.js +42 -0
  122. package/dist/utils/auth-flows.d.ts +26 -0
  123. package/dist/utils/auth-flows.js +141 -0
  124. package/dist/utils/bundling.d.ts +36 -0
  125. package/dist/utils/bundling.js +137 -0
  126. package/dist/utils/compile.d.ts +37 -0
  127. package/dist/utils/compile.js +242 -0
  128. package/dist/utils/deploy-api.d.ts +26 -0
  129. package/dist/utils/deploy-api.js +53 -0
  130. package/dist/utils/deploy-helpers.d.ts +46 -0
  131. package/dist/utils/deploy-helpers.js +86 -0
  132. package/dist/utils/deployment.d.ts +25 -0
  133. package/dist/utils/deployment.js +161 -0
  134. package/dist/utils/dev-api.d.ts +61 -0
  135. package/dist/utils/dev-api.js +262 -0
  136. package/dist/utils/dev-helpers.d.ts +46 -0
  137. package/dist/utils/dev-helpers.js +83 -0
  138. package/dist/utils/dev-server.d.ts +24 -0
  139. package/dist/utils/dev-server.js +555 -0
  140. package/dist/utils/dev-watcher.d.ts +31 -0
  141. package/dist/utils/dev-watcher.js +110 -0
  142. package/dist/utils/files.js +0 -5
  143. package/dist/utils/init-agent.d.ts +34 -0
  144. package/dist/utils/init-agent.js +129 -0
  145. package/dist/utils/init-helpers.d.ts +41 -0
  146. package/dist/utils/init-helpers.js +73 -0
  147. package/dist/utils/init-prompts.d.ts +47 -0
  148. package/dist/utils/init-prompts.js +168 -0
  149. package/dist/utils/push-api.d.ts +15 -0
  150. package/dist/utils/push-api.js +48 -0
  151. package/dist/utils/push-helpers.d.ts +38 -0
  152. package/dist/utils/push-helpers.js +84 -0
  153. package/dist/utils/sandbox-storage.d.ts +27 -0
  154. package/dist/utils/sandbox-storage.js +71 -0
  155. package/dist/utils/sandbox.js +78 -114
  156. package/dist/utils/skill-management.d.ts +14 -0
  157. package/dist/utils/skill-management.js +148 -0
  158. package/dist/utils/test-helpers.d.ts +40 -0
  159. package/dist/utils/test-helpers.js +92 -0
  160. package/dist/utils/test-prompts.d.ts +23 -0
  161. package/dist/utils/test-prompts.js +186 -0
  162. package/dist/utils/tool-detection.d.ts +18 -0
  163. package/dist/utils/tool-detection.js +110 -0
  164. package/dist/web/app.css +14 -9
  165. package/package.json +7 -4
  166. package/template/QUICKSTART.md +299 -144
  167. package/template/README.md +928 -349
  168. package/template/TOOL_EXAMPLES.md +655 -0
  169. package/template/package-lock.json +5 -5
  170. package/template/package.json +1 -1
  171. package/template/src/index.ts +147 -207
  172. package/template/src/tools/BasketTool.ts +128 -0
  173. package/template/src/tools/CustomDataTool.ts +7 -13
  174. package/template/src/tools/OrderTool.ts +54 -0
  175. package/template/src/tools/PaymentTool.ts +1 -1
  176. package/template/src/tools/ProductsTool.ts +56 -118
  177. package/template/src/tools/UserDataTool.ts +4 -26
  178. package/dist/common/config.d.ts +0 -5
  179. package/dist/common/config.js +0 -5
  180. package/dist/custom-data-api.d.ts +0 -72
  181. package/dist/custom-data-api.js +0 -174
  182. package/dist/product-api.d.ts +0 -189
  183. package/dist/product-api.js +0 -141
  184. package/dist/services/api.d.ts +0 -549
  185. package/dist/services/api.js +0 -596
  186. package/dist/skill.d.ts +0 -50
  187. package/dist/types.d.ts +0 -1
  188. package/dist/types.js +0 -2
  189. package/dist/user-data-api.d.ts +0 -39
  190. package/dist/user-data-api.js +0 -50
  191. package/template/API.md +0 -604
  192. package/template/DEVELOPER.md +0 -771
  193. package/template/lua.skill.yaml +0 -7
@@ -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,5 @@
1
+ export declare const BASE_URLS: {
2
+ readonly API: "https://api.heylua.ai";
3
+ readonly AUTH: "https://auth.heylua.ai";
4
+ readonly CHAT: "https://api.heylua.ai";
5
+ };
@@ -0,0 +1,5 @@
1
+ export const BASE_URLS = {
2
+ API: 'https://api.heylua.ai',
3
+ AUTH: 'https://auth.heylua.ai',
4
+ CHAT: 'https://api.heylua.ai',
5
+ };
@@ -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
- export { user, UserDataAPI } from './user-data-api.js';
3
- export { product, ProductAPI } from './product-api.js';
4
- export { customData, CustomDataAPI } from './custom-data-api.js';
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 { configureCommand, initCommand, destroyCommand, apiKeyCommand, compileCommand, testCommand, pushCommand, deployCommand, devCommand } from "./commands/index.js";
21
+ import { setupAuthCommands, setupSkillCommands } from "./cli/command-definitions.js";
22
+ // Create the main CLI program
4
23
  const program = new Command();
5
- const authCommand = program
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
- .command("init")
23
- .description("Initialize a new Lua skill project")
24
- .action(initCommand);
25
- program
26
- .command("compile")
27
- .description("Compile Lua skill to generate deployable format")
28
- .action(compileCommand);
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';
@@ -1,92 +1,98 @@
1
- export interface ApiResponse<T = any> {
2
- success: boolean;
3
- data?: T;
4
- error?: {
5
- message: string;
6
- statusCode?: number;
7
- };
8
- }
1
+ /**
2
+ * Admin & User Interfaces
3
+ * User data, authentication, and administrative structures
4
+ */
5
+ /**
6
+ * User data from authentication
7
+ */
9
8
  export interface UserData {
10
9
  uid: string;
11
10
  email: string;
12
11
  emailVerified: boolean;
13
12
  fullName: string;
14
13
  mobileNumbers: any[];
15
- emailAddresses: any[];
14
+ emailAddresses: EmailAddress[];
16
15
  country: any;
17
- admin: any;
16
+ admin: Admin;
18
17
  channels: Record<string, any>;
19
18
  rights: Record<string, any>;
20
19
  setupPersona: Record<string, any>;
21
20
  notifications: Record<string, any>;
22
21
  }
23
- export interface Organization {
24
- id: string;
25
- name: string;
26
- agents: string[];
27
- }
28
- export interface SkillVersion {
29
- version: string;
30
- createdAt: string;
31
- status: string;
32
- }
33
- export interface DevVersionResponse {
34
- success: boolean;
35
- data?: {
36
- message: string;
37
- skillId: string;
38
- version: string;
39
- };
40
- error?: {
41
- message: string;
42
- statusCode: number;
43
- };
44
- }
45
- export interface UpdateDevVersionResponse {
46
- success: boolean;
47
- data?: {
48
- message: string;
49
- version: string;
50
- };
51
- error?: {
52
- message: string;
53
- statusCode: number;
54
- };
55
- }
22
+ /**
23
+ * Email address with validation status
24
+ */
56
25
  export interface EmailAddress {
57
26
  address: string;
58
27
  validated: boolean;
59
28
  validatedAt: number;
60
29
  _id: string;
61
30
  }
31
+ /**
32
+ * Country information
33
+ */
62
34
  export interface Country {
63
35
  code: string;
64
36
  name: string;
65
37
  }
38
+ /**
39
+ * Admin privileges and organization access
40
+ */
66
41
  export interface Admin {
67
42
  userId: string;
68
- orgs: Organization[];
43
+ orgs: OrganizationAuth[];
69
44
  id: string;
70
45
  createdAt: number;
71
46
  __v: number;
72
47
  }
73
- export interface Agent {
74
- agentId: string;
75
- rights: string[];
76
- name: string;
77
- }
48
+ /**
49
+ * Organization with authentication context.
50
+ * Includes agents and permissions for the authenticated user.
51
+ */
78
52
  export interface OrganizationAuth {
79
53
  id: string;
80
54
  rights?: string[];
81
- agents: Agent[];
55
+ agents: AgentAuth[];
82
56
  registeredName: string;
83
57
  country: string;
84
58
  phoneNumber?: string | null;
85
59
  type: string;
86
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
+ */
87
90
  export interface OTPResponse {
88
91
  signInToken: string;
89
92
  }
93
+ /**
94
+ * API key generation response
95
+ */
90
96
  export interface ApiKeyResponse {
91
97
  message: string;
92
98
  userId: string;
@@ -1 +1,5 @@
1
+ /**
2
+ * Admin & User Interfaces
3
+ * User data, authentication, and administrative structures
4
+ */
1
5
  export {};
@@ -1,3 +1,11 @@
1
+ /**
2
+ * Agent Interfaces
3
+ * Agent management, types, and creation
4
+ */
5
+ /**
6
+ * Full agent entity with configuration.
7
+ * Represents a complete agent with all properties.
8
+ */
1
9
  export interface Agent {
2
10
  id: string;
3
11
  name: string;
@@ -5,12 +13,19 @@ export interface Agent {
5
13
  welcomeMessage?: string;
6
14
  featuresOverride?: Record<string, any>;
7
15
  }
16
+ /**
17
+ * Agent type definition with feature templates.
18
+ * Defines what type of agent can be created and what features it supports.
19
+ */
8
20
  export interface AgentType {
9
21
  id: string;
10
22
  name: string;
11
23
  features: Record<string, any>;
12
24
  requiredSubAgentMetadata?: string[];
13
25
  }
26
+ /**
27
+ * Request payload for creating a new agent.
28
+ */
14
29
  export interface CreateAgentRequest {
15
30
  id: string;
16
31
  type: string;
@@ -27,6 +42,9 @@ export interface CreateAgentRequest {
27
42
  registeredName: string;
28
43
  };
29
44
  }
45
+ /**
46
+ * Response from agent creation API.
47
+ */
30
48
  export interface CreateAgentResponse {
31
49
  success: boolean;
32
50
  data?: {
@@ -57,6 +75,9 @@ export interface CreateAgentResponse {
57
75
  statusCode: number;
58
76
  };
59
77
  }
78
+ /**
79
+ * Response from get agent details API.
80
+ */
60
81
  export interface AgentDetailsResponse {
61
82
  success: boolean;
62
83
  data?: {
@@ -1 +1,5 @@
1
+ /**
2
+ * Agent Interfaces
3
+ * Agent management, types, and creation
4
+ */
1
5
  export {};