lua-cli 3.9.2 → 3.9.3

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 (85) hide show
  1. package/README.md +90 -2
  2. package/dist/api/agent.api.service.d.ts +8 -0
  3. package/dist/api/agent.api.service.d.ts.map +1 -1
  4. package/dist/api/agent.api.service.js +12 -0
  5. package/dist/api/agent.api.service.js.map +1 -1
  6. package/dist/cli/command-definitions.d.ts.map +1 -1
  7. package/dist/cli/command-definitions.js +25 -22
  8. package/dist/cli/command-definitions.js.map +1 -1
  9. package/dist/commands/agents.d.ts.map +1 -1
  10. package/dist/commands/agents.js +2 -11
  11. package/dist/commands/agents.js.map +1 -1
  12. package/dist/commands/apiKey.d.ts +1 -21
  13. package/dist/commands/apiKey.d.ts.map +1 -1
  14. package/dist/commands/apiKey.js +7 -25
  15. package/dist/commands/apiKey.js.map +1 -1
  16. package/dist/commands/compile.d.ts.map +1 -1
  17. package/dist/commands/compile.js +11 -3
  18. package/dist/commands/compile.js.map +1 -1
  19. package/dist/commands/configure.d.ts +2 -2
  20. package/dist/commands/configure.js +2 -2
  21. package/dist/commands/destroy.d.ts +0 -24
  22. package/dist/commands/destroy.d.ts.map +1 -1
  23. package/dist/commands/destroy.js +8 -30
  24. package/dist/commands/destroy.js.map +1 -1
  25. package/dist/commands/init.d.ts +1 -0
  26. package/dist/commands/init.d.ts.map +1 -1
  27. package/dist/commands/init.js +102 -39
  28. package/dist/commands/init.js.map +1 -1
  29. package/dist/commands/jobs.js +29 -9
  30. package/dist/commands/jobs.js.map +1 -1
  31. package/dist/compiler/source-writer.d.ts.map +1 -1
  32. package/dist/compiler/source-writer.js +22 -1
  33. package/dist/compiler/source-writer.js.map +1 -1
  34. package/dist/config/constants.d.ts +7 -11
  35. package/dist/config/constants.d.ts.map +1 -1
  36. package/dist/config/constants.js +7 -11
  37. package/dist/config/constants.js.map +1 -1
  38. package/dist/index.js +0 -0
  39. package/dist/interfaces/agent.d.ts +11 -0
  40. package/dist/interfaces/agent.d.ts.map +1 -1
  41. package/dist/services/analytics.d.ts.map +1 -1
  42. package/dist/services/analytics.js +6 -2
  43. package/dist/services/analytics.js.map +1 -1
  44. package/dist/services/auth.d.ts +16 -26
  45. package/dist/services/auth.d.ts.map +1 -1
  46. package/dist/services/auth.js +45 -101
  47. package/dist/services/auth.js.map +1 -1
  48. package/dist/types/skill.js.map +1 -1
  49. package/dist/utils/auth-flows.d.ts.map +1 -1
  50. package/dist/utils/auth-flows.js +8 -12
  51. package/dist/utils/auth-flows.js.map +1 -1
  52. package/dist/utils/cli.d.ts.map +1 -1
  53. package/dist/utils/cli.js +2 -3
  54. package/dist/utils/cli.js.map +1 -1
  55. package/dist/utils/command-utils.d.ts +4 -3
  56. package/dist/utils/command-utils.d.ts.map +1 -1
  57. package/dist/utils/command-utils.js +9 -20
  58. package/dist/utils/command-utils.js.map +1 -1
  59. package/dist/utils/init-agent.d.ts +30 -1
  60. package/dist/utils/init-agent.d.ts.map +1 -1
  61. package/dist/utils/init-agent.js +56 -1
  62. package/dist/utils/init-agent.js.map +1 -1
  63. package/dist/utils/init-helpers.d.ts +2 -1
  64. package/dist/utils/init-helpers.d.ts.map +1 -1
  65. package/dist/utils/init-helpers.js +3 -2
  66. package/dist/utils/init-helpers.js.map +1 -1
  67. package/dist/utils/init-prompts.d.ts +10 -0
  68. package/dist/utils/init-prompts.d.ts.map +1 -1
  69. package/dist/utils/init-prompts.js +42 -2
  70. package/dist/utils/init-prompts.js.map +1 -1
  71. package/dist/utils/sandbox-storage.d.ts +18 -18
  72. package/dist/utils/sandbox-storage.d.ts.map +1 -1
  73. package/dist/utils/sandbox-storage.js +77 -101
  74. package/dist/utils/sandbox-storage.js.map +1 -1
  75. package/docs/README.md +3 -3
  76. package/node_modules/@lua/shared-types/dist/index.d.mts +54 -1
  77. package/node_modules/@lua/shared-types/dist/index.d.ts +54 -1
  78. package/node_modules/@lua/shared-types/dist/index.js +114 -0
  79. package/node_modules/@lua/shared-types/dist/index.mjs +109 -0
  80. package/package.json +5 -7
  81. package/template/package.json +1 -1
  82. package/dist/utils/keytar-loader.d.ts +0 -20
  83. package/dist/utils/keytar-loader.d.ts.map +0 -1
  84. package/dist/utils/keytar-loader.js +0 -35
  85. package/dist/utils/keytar-loader.js.map +0 -1
@@ -89,4 +89,57 @@ interface AiGenerateOutput {
89
89
  */
90
90
  declare function aiGenerateInputFromSimplified(prompt: string, content?: UserContent): AiGenerateInput;
91
91
 
92
- export { type AiGenerateInput, type AiGenerateOutput, type AiGenerateSource, type AiGenerateToolCall, type AiGenerateToolResult, type Channel, UNSTRUCTURED_SUPPORTED_MEDIA_TYPES, aiGenerateInputFromSimplified };
92
+ /**
93
+ * Sandbox contract: defines what every sandbox MUST expose.
94
+ * Both lua-cli and lua-core test against this contract.
95
+ * Update this file when adding new globals or primitives.
96
+ */
97
+ declare const REQUIRED_PRIMITIVE_SHIMS: readonly ["LuaTool", "LuaSkill", "LuaJob", "LuaWebhook", "PreProcessor", "LuaPreprocessor", "PostProcessor", "LuaPostprocessor", "LuaMCPServer", "defineTool", "defineSkill", "defineJob", "defineWebhook", "definePreProcessor", "definePostProcessor", "defineMCPServer"];
98
+ declare const REQUIRED_PLATFORM_APIS: {
99
+ readonly User: readonly ["get", "getChatHistory"];
100
+ readonly Products: readonly ["get", "create", "delete", "search", "getById"];
101
+ readonly Baskets: readonly ["create", "get", "addItem", "removeItem", "clear", "updateStatus", "updateMetadata", "placeOrder", "getById"];
102
+ readonly Orders: readonly ["create", "updateStatus", "updateData", "get", "getById"];
103
+ readonly Data: readonly ["create", "get", "getEntry", "update", "search", "delete"];
104
+ readonly Jobs: readonly ["create", "getJob", "getAll"];
105
+ readonly AI: readonly ["generate"];
106
+ readonly CDN: readonly ["upload", "get"];
107
+ };
108
+ declare const REQUIRED_NESTED_APIS: {
109
+ readonly Templates: {
110
+ readonly whatsapp: readonly ["list", "get", "send"];
111
+ };
112
+ readonly Lua: {
113
+ readonly request: readonly ["channel"];
114
+ };
115
+ };
116
+ declare const REQUIRED_ENUMS: {
117
+ readonly BasketStatus: readonly ["ACTIVE", "CHECKED_OUT", "ABANDONED", "EXPIRED"];
118
+ readonly OrderStatus: readonly ["PENDING", "CONFIRMED", "FULFILLED", "CANCELLED"];
119
+ };
120
+ declare const REQUIRED_UTILITIES: readonly ["env"];
121
+
122
+ /**
123
+ * Shared type definitions for the model registry.
124
+ *
125
+ * Runtime data (provider configs, context windows, approved model list) lives
126
+ * exclusively in the MongoDB `approvedModels` collection. lua-core loads it at
127
+ * startup via initModelRegistry() in mastra/common/model-registry.ts.
128
+ */
129
+ interface ApprovedModelDef {
130
+ provider: string;
131
+ /** Full user-facing model string, e.g. "zhipuai/glm-5". */
132
+ code: string;
133
+ /** Model ID portion for display, e.g. "glm-5". */
134
+ model: string;
135
+ description: string;
136
+ /** Advertised input token context window (raw, from provider docs). */
137
+ contextWindow?: number;
138
+ /** If set, route requests through a gateway instead of calling the provider directly. */
139
+ gateway?: {
140
+ via: string;
141
+ modelPrefix: string;
142
+ };
143
+ }
144
+
145
+ export { type AiGenerateInput, type AiGenerateOutput, type AiGenerateSource, type AiGenerateToolCall, type AiGenerateToolResult, type ApprovedModelDef, type Channel, REQUIRED_ENUMS, REQUIRED_NESTED_APIS, REQUIRED_PLATFORM_APIS, REQUIRED_PRIMITIVE_SHIMS, REQUIRED_UTILITIES, UNSTRUCTURED_SUPPORTED_MEDIA_TYPES, aiGenerateInputFromSimplified };
@@ -20,6 +20,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ REQUIRED_ENUMS: () => REQUIRED_ENUMS,
24
+ REQUIRED_NESTED_APIS: () => REQUIRED_NESTED_APIS,
25
+ REQUIRED_PLATFORM_APIS: () => REQUIRED_PLATFORM_APIS,
26
+ REQUIRED_PRIMITIVE_SHIMS: () => REQUIRED_PRIMITIVE_SHIMS,
27
+ REQUIRED_UTILITIES: () => REQUIRED_UTILITIES,
23
28
  UNSTRUCTURED_SUPPORTED_MEDIA_TYPES: () => UNSTRUCTURED_SUPPORTED_MEDIA_TYPES,
24
29
  aiGenerateInputFromSimplified: () => aiGenerateInputFromSimplified
25
30
  });
@@ -97,8 +102,117 @@ function aiGenerateInputFromSimplified(prompt, content) {
97
102
  };
98
103
  }
99
104
  __name(aiGenerateInputFromSimplified, "aiGenerateInputFromSimplified");
105
+
106
+ // src/sandbox-contract.ts
107
+ var REQUIRED_PRIMITIVE_SHIMS = [
108
+ // Class-based
109
+ "LuaTool",
110
+ "LuaSkill",
111
+ "LuaJob",
112
+ "LuaWebhook",
113
+ "PreProcessor",
114
+ "LuaPreprocessor",
115
+ "PostProcessor",
116
+ "LuaPostprocessor",
117
+ "LuaMCPServer",
118
+ // Function-based
119
+ "defineTool",
120
+ "defineSkill",
121
+ "defineJob",
122
+ "defineWebhook",
123
+ "definePreProcessor",
124
+ "definePostProcessor",
125
+ "defineMCPServer"
126
+ ];
127
+ var REQUIRED_PLATFORM_APIS = {
128
+ User: [
129
+ "get",
130
+ "getChatHistory"
131
+ ],
132
+ Products: [
133
+ "get",
134
+ "create",
135
+ "delete",
136
+ "search",
137
+ "getById"
138
+ ],
139
+ Baskets: [
140
+ "create",
141
+ "get",
142
+ "addItem",
143
+ "removeItem",
144
+ "clear",
145
+ "updateStatus",
146
+ "updateMetadata",
147
+ "placeOrder",
148
+ "getById"
149
+ ],
150
+ Orders: [
151
+ "create",
152
+ "updateStatus",
153
+ "updateData",
154
+ "get",
155
+ "getById"
156
+ ],
157
+ Data: [
158
+ "create",
159
+ "get",
160
+ "getEntry",
161
+ "update",
162
+ "search",
163
+ "delete"
164
+ ],
165
+ Jobs: [
166
+ "create",
167
+ "getJob",
168
+ "getAll"
169
+ ],
170
+ AI: [
171
+ "generate"
172
+ ],
173
+ CDN: [
174
+ "upload",
175
+ "get"
176
+ ]
177
+ };
178
+ var REQUIRED_NESTED_APIS = {
179
+ Templates: {
180
+ whatsapp: [
181
+ "list",
182
+ "get",
183
+ "send"
184
+ ]
185
+ },
186
+ Lua: {
187
+ request: [
188
+ "channel"
189
+ ]
190
+ }
191
+ };
192
+ var REQUIRED_ENUMS = {
193
+ BasketStatus: [
194
+ "ACTIVE",
195
+ "CHECKED_OUT",
196
+ "ABANDONED",
197
+ "EXPIRED"
198
+ ],
199
+ OrderStatus: [
200
+ "PENDING",
201
+ "CONFIRMED",
202
+ "FULFILLED",
203
+ "CANCELLED"
204
+ ]
205
+ };
206
+ var REQUIRED_UTILITIES = [
207
+ "env"
208
+ ];
100
209
  // Annotate the CommonJS export names for ESM import in node:
101
210
  0 && (module.exports = {
211
+ REQUIRED_ENUMS,
212
+ REQUIRED_NESTED_APIS,
213
+ REQUIRED_PLATFORM_APIS,
214
+ REQUIRED_PRIMITIVE_SHIMS,
215
+ REQUIRED_UTILITIES,
102
216
  UNSTRUCTURED_SUPPORTED_MEDIA_TYPES,
103
217
  aiGenerateInputFromSimplified
104
218
  });
@@ -73,7 +73,116 @@ function aiGenerateInputFromSimplified(prompt, content) {
73
73
  };
74
74
  }
75
75
  __name(aiGenerateInputFromSimplified, "aiGenerateInputFromSimplified");
76
+
77
+ // src/sandbox-contract.ts
78
+ var REQUIRED_PRIMITIVE_SHIMS = [
79
+ // Class-based
80
+ "LuaTool",
81
+ "LuaSkill",
82
+ "LuaJob",
83
+ "LuaWebhook",
84
+ "PreProcessor",
85
+ "LuaPreprocessor",
86
+ "PostProcessor",
87
+ "LuaPostprocessor",
88
+ "LuaMCPServer",
89
+ // Function-based
90
+ "defineTool",
91
+ "defineSkill",
92
+ "defineJob",
93
+ "defineWebhook",
94
+ "definePreProcessor",
95
+ "definePostProcessor",
96
+ "defineMCPServer"
97
+ ];
98
+ var REQUIRED_PLATFORM_APIS = {
99
+ User: [
100
+ "get",
101
+ "getChatHistory"
102
+ ],
103
+ Products: [
104
+ "get",
105
+ "create",
106
+ "delete",
107
+ "search",
108
+ "getById"
109
+ ],
110
+ Baskets: [
111
+ "create",
112
+ "get",
113
+ "addItem",
114
+ "removeItem",
115
+ "clear",
116
+ "updateStatus",
117
+ "updateMetadata",
118
+ "placeOrder",
119
+ "getById"
120
+ ],
121
+ Orders: [
122
+ "create",
123
+ "updateStatus",
124
+ "updateData",
125
+ "get",
126
+ "getById"
127
+ ],
128
+ Data: [
129
+ "create",
130
+ "get",
131
+ "getEntry",
132
+ "update",
133
+ "search",
134
+ "delete"
135
+ ],
136
+ Jobs: [
137
+ "create",
138
+ "getJob",
139
+ "getAll"
140
+ ],
141
+ AI: [
142
+ "generate"
143
+ ],
144
+ CDN: [
145
+ "upload",
146
+ "get"
147
+ ]
148
+ };
149
+ var REQUIRED_NESTED_APIS = {
150
+ Templates: {
151
+ whatsapp: [
152
+ "list",
153
+ "get",
154
+ "send"
155
+ ]
156
+ },
157
+ Lua: {
158
+ request: [
159
+ "channel"
160
+ ]
161
+ }
162
+ };
163
+ var REQUIRED_ENUMS = {
164
+ BasketStatus: [
165
+ "ACTIVE",
166
+ "CHECKED_OUT",
167
+ "ABANDONED",
168
+ "EXPIRED"
169
+ ],
170
+ OrderStatus: [
171
+ "PENDING",
172
+ "CONFIRMED",
173
+ "FULFILLED",
174
+ "CANCELLED"
175
+ ]
176
+ };
177
+ var REQUIRED_UTILITIES = [
178
+ "env"
179
+ ];
76
180
  export {
181
+ REQUIRED_ENUMS,
182
+ REQUIRED_NESTED_APIS,
183
+ REQUIRED_PLATFORM_APIS,
184
+ REQUIRED_PRIMITIVE_SHIMS,
185
+ REQUIRED_UTILITIES,
77
186
  UNSTRUCTURED_SUPPORTED_MEDIA_TYPES,
78
187
  aiGenerateInputFromSimplified
79
188
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lua-cli",
3
- "version": "3.9.2",
3
+ "version": "3.9.3",
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-cli.git"
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"
@@ -60,7 +61,7 @@
60
61
  "LICENSE"
61
62
  ],
62
63
  "dependencies": {
63
- "@lua/shared-types": "0.0.1",
64
+ "@lua/shared-types": "workspace:*",
64
65
  "@tailwindcss/postcss": "^4.1.14",
65
66
  "@tanstack/react-query": "^5.90.11",
66
67
  "ai": "^5.0.76",
@@ -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",
@@ -20,7 +20,7 @@
20
20
  "inquirer": "^12.9.6",
21
21
  "stripe": "^17.5.0",
22
22
  "js-yaml": "^4.1.0",
23
- "lua-cli": "^3.9.2",
23
+ "lua-cli": "^3.9.3",
24
24
  "openai": "^5.23.0",
25
25
  "uuid": "^13.0.0",
26
26
  "zod": "^3.24.1"
@@ -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"}