lua-cli 3.5.0-alpha.3 → 3.5.0-beta.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 (465) hide show
  1. package/README.md +137 -689
  2. package/dist/api/agent.api.service.d.ts +1 -8
  3. package/dist/api/agent.api.service.js +1 -11
  4. package/dist/api/agent.api.service.js.map +1 -1
  5. package/dist/api/auth.api.service.d.ts +1 -1
  6. package/dist/api/auth.api.service.js +1 -1
  7. package/dist/api/auth.api.service.js.map +1 -1
  8. package/dist/api/backup.api.service.d.ts +80 -0
  9. package/dist/api/backup.api.service.js +101 -0
  10. package/dist/api/backup.api.service.js.map +1 -0
  11. package/dist/api/basket.api.service.d.ts +4 -5
  12. package/dist/api/basket.api.service.js +13 -18
  13. package/dist/api/basket.api.service.js.map +1 -1
  14. package/dist/api/cdn.api.service.d.ts +2 -0
  15. package/dist/api/cdn.api.service.js +2 -0
  16. package/dist/api/cdn.api.service.js.map +1 -1
  17. package/dist/api/chat.api.service.d.ts +10 -2
  18. package/dist/api/chat.api.service.js +21 -2
  19. package/dist/api/chat.api.service.js.map +1 -1
  20. package/dist/api/credentials.js +5 -8
  21. package/dist/api/credentials.js.map +1 -1
  22. package/dist/api/custom.data.api.service.d.ts +3 -3
  23. package/dist/api/custom.data.api.service.js +9 -10
  24. package/dist/api/custom.data.api.service.js.map +1 -1
  25. package/dist/api/developer.api.service.d.ts +1 -1
  26. package/dist/api/developer.api.service.js +1 -1
  27. package/dist/api/developer.api.service.js.map +1 -1
  28. package/dist/api/http.client.js.map +1 -0
  29. package/dist/api/job.api.service.d.ts +2 -2
  30. package/dist/api/job.api.service.js +2 -2
  31. package/dist/api/job.api.service.js.map +1 -1
  32. package/dist/api/logs.api.service.d.ts +1 -1
  33. package/dist/api/logs.api.service.js +1 -1
  34. package/dist/api/logs.api.service.js.map +1 -1
  35. package/dist/api/marketplace.api.service.d.ts +6 -6
  36. package/dist/api/marketplace.api.service.js.map +1 -1
  37. package/dist/api/order.api.service.d.ts +3 -4
  38. package/dist/api/order.api.service.js +8 -10
  39. package/dist/api/order.api.service.js.map +1 -1
  40. package/dist/api/persona.api.service.d.ts +1 -1
  41. package/dist/api/persona.api.service.js +1 -1
  42. package/dist/api/persona.api.service.js.map +1 -1
  43. package/dist/api/postprocessor.api.service.d.ts +1 -1
  44. package/dist/api/postprocessor.api.service.js +1 -1
  45. package/dist/api/postprocessor.api.service.js.map +1 -1
  46. package/dist/api/preprocessor.api.service.d.ts +1 -1
  47. package/dist/api/preprocessor.api.service.js +1 -1
  48. package/dist/api/preprocessor.api.service.js.map +1 -1
  49. package/dist/api/products.api.service.d.ts +4 -4
  50. package/dist/api/products.api.service.js +6 -6
  51. package/dist/api/products.api.service.js.map +1 -1
  52. package/dist/api/resource.api.service.d.ts +76 -0
  53. package/dist/api/resource.api.service.js +74 -0
  54. package/dist/api/resource.api.service.js.map +1 -0
  55. package/dist/api/skills.api.service.d.ts +7 -15
  56. package/dist/api/skills.api.service.js +1 -1
  57. package/dist/api/skills.api.service.js.map +1 -1
  58. package/dist/api/tool.api.service.d.ts +1 -1
  59. package/dist/api/tool.api.service.js +1 -1
  60. package/dist/api/tool.api.service.js.map +1 -1
  61. package/dist/api/unifiedto.api.service.d.ts +1 -1
  62. package/dist/api/unifiedto.api.service.js +1 -1
  63. package/dist/api/unifiedto.api.service.js.map +1 -1
  64. package/dist/api/user.data.api.service.d.ts +7 -8
  65. package/dist/api/user.data.api.service.js +2 -3
  66. package/dist/api/user.data.api.service.js.map +1 -1
  67. package/dist/api/webhook.api.service.d.ts +1 -1
  68. package/dist/api/webhook.api.service.js +1 -1
  69. package/dist/api/webhook.api.service.js.map +1 -1
  70. package/dist/api/whatsapp-templates.api.service.d.ts +1 -1
  71. package/dist/api/whatsapp-templates.api.service.js +1 -1
  72. package/dist/api/whatsapp-templates.api.service.js.map +1 -1
  73. package/dist/api-exports.d.ts +14 -12
  74. package/dist/api-exports.js +8 -8
  75. package/dist/api-exports.js.map +1 -1
  76. package/dist/cli/command-definitions.js +32 -17
  77. package/dist/cli/command-definitions.js.map +1 -1
  78. package/dist/commands/admin.js +3 -24
  79. package/dist/commands/admin.js.map +1 -1
  80. package/dist/commands/agents.d.ts +8 -7
  81. package/dist/commands/agents.js +63 -21
  82. package/dist/commands/agents.js.map +1 -1
  83. package/dist/commands/channels.js +11 -23
  84. package/dist/commands/channels.js.map +1 -1
  85. package/dist/commands/chat.js +33 -47
  86. package/dist/commands/chat.js.map +1 -1
  87. package/dist/commands/chatClear.js +11 -41
  88. package/dist/commands/chatClear.js.map +1 -1
  89. package/dist/commands/compile.d.ts +26 -23
  90. package/dist/commands/compile.js +98 -403
  91. package/dist/commands/compile.js.map +1 -1
  92. package/dist/commands/completion.js +1 -1
  93. package/dist/commands/completion.js.map +1 -1
  94. package/dist/commands/deploy.js +55 -25
  95. package/dist/commands/deploy.js.map +1 -1
  96. package/dist/commands/dev.js +29 -45
  97. package/dist/commands/dev.js.map +1 -1
  98. package/dist/commands/env.js +12 -25
  99. package/dist/commands/env.js.map +1 -1
  100. package/dist/commands/evals.js +3 -20
  101. package/dist/commands/evals.js.map +1 -1
  102. package/dist/commands/features.js +10 -23
  103. package/dist/commands/features.js.map +1 -1
  104. package/dist/commands/index.d.ts +1 -0
  105. package/dist/commands/index.js +1 -0
  106. package/dist/commands/index.js.map +1 -1
  107. package/dist/commands/init.d.ts +1 -0
  108. package/dist/commands/init.js +135 -19
  109. package/dist/commands/init.js.map +1 -1
  110. package/dist/commands/integrations.js +26 -37
  111. package/dist/commands/integrations.js.map +1 -1
  112. package/dist/commands/jobs.js +32 -56
  113. package/dist/commands/jobs.js.map +1 -1
  114. package/dist/commands/logs.js +9 -20
  115. package/dist/commands/logs.js.map +1 -1
  116. package/dist/commands/marketplace.js +34 -52
  117. package/dist/commands/marketplace.js.map +1 -1
  118. package/dist/commands/mcp.js +10 -23
  119. package/dist/commands/mcp.js.map +1 -1
  120. package/dist/commands/persona.js +43 -74
  121. package/dist/commands/persona.js.map +1 -1
  122. package/dist/commands/postprocessors.js +15 -28
  123. package/dist/commands/postprocessors.js.map +1 -1
  124. package/dist/commands/preprocessors.js +15 -28
  125. package/dist/commands/preprocessors.js.map +1 -1
  126. package/dist/commands/production.js +30 -63
  127. package/dist/commands/production.js.map +1 -1
  128. package/dist/commands/push.js +294 -1241
  129. package/dist/commands/push.js.map +1 -1
  130. package/dist/commands/pushBackup.d.ts +22 -0
  131. package/dist/commands/pushBackup.js +133 -0
  132. package/dist/commands/pushBackup.js.map +1 -0
  133. package/dist/commands/resources.js +29 -72
  134. package/dist/commands/resources.js.map +1 -1
  135. package/dist/commands/skills.d.ts +1 -1
  136. package/dist/commands/skills.js +58 -70
  137. package/dist/commands/skills.js.map +1 -1
  138. package/dist/commands/sync.d.ts +1 -3
  139. package/dist/commands/sync.js +12 -24
  140. package/dist/commands/sync.js.map +1 -1
  141. package/dist/commands/test.js +135 -104
  142. package/dist/commands/test.js.map +1 -1
  143. package/dist/commands/webhooks.js +15 -28
  144. package/dist/commands/webhooks.js.map +1 -1
  145. package/dist/compiler/agent-traverser.d.ts +104 -0
  146. package/dist/compiler/agent-traverser.js +311 -0
  147. package/dist/compiler/agent-traverser.js.map +1 -0
  148. package/dist/compiler/bundler.d.ts +42 -0
  149. package/dist/compiler/bundler.js +187 -0
  150. package/dist/compiler/bundler.js.map +1 -0
  151. package/dist/compiler/compiler.d.ts +177 -0
  152. package/dist/compiler/compiler.js +580 -0
  153. package/dist/compiler/compiler.js.map +1 -0
  154. package/dist/compiler/index.d.ts +36 -0
  155. package/dist/compiler/index.js +42 -0
  156. package/dist/compiler/index.js.map +1 -0
  157. package/dist/compiler/plugins/base.d.ts +264 -0
  158. package/dist/compiler/plugins/base.js +307 -0
  159. package/dist/compiler/plugins/base.js.map +1 -0
  160. package/dist/compiler/plugins/job.plugin.d.ts +33 -0
  161. package/dist/compiler/plugins/job.plugin.js +143 -0
  162. package/dist/compiler/plugins/job.plugin.js.map +1 -0
  163. package/dist/compiler/plugins/mcp-server.plugin.d.ts +50 -0
  164. package/dist/compiler/plugins/mcp-server.plugin.js +186 -0
  165. package/dist/compiler/plugins/mcp-server.plugin.js.map +1 -0
  166. package/dist/compiler/plugins/postprocessor.plugin.d.ts +20 -0
  167. package/dist/compiler/plugins/postprocessor.plugin.js +39 -0
  168. package/dist/compiler/plugins/postprocessor.plugin.js.map +1 -0
  169. package/dist/compiler/plugins/preprocessor.plugin.d.ts +20 -0
  170. package/dist/compiler/plugins/preprocessor.plugin.js +48 -0
  171. package/dist/compiler/plugins/preprocessor.plugin.js.map +1 -0
  172. package/dist/compiler/plugins/processor-base.d.ts +16 -0
  173. package/dist/compiler/plugins/processor-base.js +34 -0
  174. package/dist/compiler/plugins/processor-base.js.map +1 -0
  175. package/dist/compiler/plugins/registry.d.ts +61 -0
  176. package/dist/compiler/plugins/registry.js +107 -0
  177. package/dist/compiler/plugins/registry.js.map +1 -0
  178. package/dist/compiler/plugins/skill.plugin.d.ts +71 -0
  179. package/dist/compiler/plugins/skill.plugin.js +243 -0
  180. package/dist/compiler/plugins/skill.plugin.js.map +1 -0
  181. package/dist/compiler/plugins/tool.plugin.d.ts +67 -0
  182. package/dist/compiler/plugins/tool.plugin.js +279 -0
  183. package/dist/compiler/plugins/tool.plugin.js.map +1 -0
  184. package/dist/compiler/plugins/webhook.plugin.d.ts +37 -0
  185. package/dist/compiler/plugins/webhook.plugin.js +127 -0
  186. package/dist/compiler/plugins/webhook.plugin.js.map +1 -0
  187. package/dist/compiler/source-writer.d.ts +98 -0
  188. package/dist/compiler/source-writer.js +223 -0
  189. package/dist/compiler/source-writer.js.map +1 -0
  190. package/dist/compiler/types.d.ts +289 -0
  191. package/dist/compiler/types.js +20 -0
  192. package/dist/compiler/types.js.map +1 -0
  193. package/dist/compiler/utils/ast-helpers.d.ts +57 -0
  194. package/dist/compiler/utils/ast-helpers.js +164 -0
  195. package/dist/compiler/utils/ast-helpers.js.map +1 -0
  196. package/dist/compiler/utils/common.d.ts +23 -0
  197. package/dist/compiler/utils/common.js +66 -0
  198. package/dist/compiler/utils/common.js.map +1 -0
  199. package/dist/compiler/utils/file-discovery.d.ts +34 -0
  200. package/dist/compiler/utils/file-discovery.js +68 -0
  201. package/dist/compiler/utils/file-discovery.js.map +1 -0
  202. package/dist/compiler/utils/path-resolver.d.ts +25 -0
  203. package/dist/compiler/utils/path-resolver.js +66 -0
  204. package/dist/compiler/utils/path-resolver.js.map +1 -0
  205. package/dist/compiler/utils/schema-converter.d.ts +26 -0
  206. package/dist/compiler/utils/schema-converter.js +94 -0
  207. package/dist/compiler/utils/schema-converter.js.map +1 -0
  208. package/dist/config/compile.constants.d.ts +2 -22
  209. package/dist/config/compile.constants.js +2 -49
  210. package/dist/config/compile.constants.js.map +1 -1
  211. package/dist/config/constants.d.ts +18 -2
  212. package/dist/config/constants.js +28 -8
  213. package/dist/config/constants.js.map +1 -1
  214. package/dist/config/dev.constants.d.ts +0 -10
  215. package/dist/config/dev.constants.js +0 -10
  216. package/dist/config/dev.constants.js.map +1 -1
  217. package/dist/index.js +7 -0
  218. package/dist/index.js.map +1 -1
  219. package/dist/instances/basket.instance.js.map +1 -0
  220. package/dist/instances/data.entry.instance.js.map +1 -0
  221. package/dist/instances/job.instance.js.map +1 -0
  222. package/dist/instances/order.instance.js.map +1 -0
  223. package/dist/instances/product.instance.js.map +1 -0
  224. package/dist/instances/product.pagination.instance.js.map +1 -0
  225. package/dist/instances/product.search.instance.js.map +1 -0
  226. package/dist/instances/user.instance.js.map +1 -0
  227. package/dist/interfaces/admin.d.ts +0 -38
  228. package/dist/interfaces/backup.d.ts +125 -0
  229. package/dist/interfaces/backup.js +8 -0
  230. package/dist/interfaces/backup.js.map +1 -0
  231. package/dist/interfaces/baskets.d.ts +0 -56
  232. package/dist/interfaces/common.d.ts +1 -0
  233. package/dist/interfaces/deploy.d.ts +0 -15
  234. package/dist/interfaces/index.d.ts +1 -1
  235. package/dist/interfaces/marketplace.d.ts +51 -0
  236. package/dist/interfaces/marketplace.js +1 -1
  237. package/dist/interfaces/marketplace.js.map +1 -1
  238. package/dist/interfaces/message.d.ts +0 -3
  239. package/dist/interfaces/orders.d.ts +0 -24
  240. package/dist/interfaces/postprocessors.d.ts +0 -18
  241. package/dist/interfaces/preprocessors.d.ts +0 -18
  242. package/dist/interfaces/skills.d.ts +61 -0
  243. package/dist/interfaces/user.d.ts +25 -0
  244. package/dist/interfaces/webhooks.d.ts +0 -9
  245. package/dist/primitives/base.handler.d.ts +106 -0
  246. package/dist/primitives/base.handler.js +370 -0
  247. package/dist/primitives/base.handler.js.map +1 -0
  248. package/dist/primitives/index.d.ts +47 -0
  249. package/dist/primitives/index.js +78 -0
  250. package/dist/primitives/index.js.map +1 -0
  251. package/dist/primitives/job.handler.d.ts +52 -0
  252. package/dist/primitives/job.handler.js +118 -0
  253. package/dist/primitives/job.handler.js.map +1 -0
  254. package/dist/primitives/mcp-server.handler.d.ts +54 -0
  255. package/dist/primitives/mcp-server.handler.js +91 -0
  256. package/dist/primitives/mcp-server.handler.js.map +1 -0
  257. package/dist/primitives/postprocessor.handler.d.ts +49 -0
  258. package/dist/primitives/postprocessor.handler.js +81 -0
  259. package/dist/primitives/postprocessor.handler.js.map +1 -0
  260. package/dist/primitives/preprocessor.handler.d.ts +54 -0
  261. package/dist/primitives/preprocessor.handler.js +95 -0
  262. package/dist/primitives/preprocessor.handler.js.map +1 -0
  263. package/dist/primitives/skill.handler.d.ts +44 -0
  264. package/dist/primitives/skill.handler.js +192 -0
  265. package/dist/primitives/skill.handler.js.map +1 -0
  266. package/dist/primitives/types.d.ts +72 -0
  267. package/dist/primitives/types.js +17 -0
  268. package/dist/primitives/types.js.map +1 -0
  269. package/dist/primitives/webhook.handler.d.ts +50 -0
  270. package/dist/primitives/webhook.handler.js +96 -0
  271. package/dist/primitives/webhook.handler.js.map +1 -0
  272. package/dist/services/auth.js +1 -2
  273. package/dist/services/auth.js.map +1 -1
  274. package/dist/services/sandbox.service.d.ts +103 -0
  275. package/dist/services/sandbox.service.js +479 -0
  276. package/dist/services/sandbox.service.js.map +1 -0
  277. package/dist/types/api-contracts.d.ts +1 -1
  278. package/dist/types/index.d.ts +2 -1
  279. package/dist/types/index.js.map +1 -1
  280. package/dist/types/skill.d.ts +8 -2
  281. package/dist/types/skill.js +8 -0
  282. package/dist/types/skill.js.map +1 -1
  283. package/dist/types/yaml.types.d.ts +69 -0
  284. package/dist/types/yaml.types.js +6 -0
  285. package/dist/types/yaml.types.js.map +1 -0
  286. package/dist/utils/artifact-loader.d.ts +108 -0
  287. package/dist/utils/artifact-loader.js +188 -0
  288. package/dist/utils/artifact-loader.js.map +1 -0
  289. package/dist/utils/backup-helpers.d.ts +122 -0
  290. package/dist/utils/backup-helpers.js +274 -0
  291. package/dist/utils/backup-helpers.js.map +1 -0
  292. package/dist/utils/cli.d.ts +8 -0
  293. package/dist/utils/cli.js +19 -2
  294. package/dist/utils/cli.js.map +1 -1
  295. package/dist/utils/command-utils.d.ts +42 -0
  296. package/dist/utils/command-utils.js +83 -0
  297. package/dist/utils/command-utils.js.map +1 -0
  298. package/dist/utils/deploy-helpers.d.ts +0 -29
  299. package/dist/utils/deploy-helpers.js +0 -70
  300. package/dist/utils/deploy-helpers.js.map +1 -1
  301. package/dist/utils/dev-api.d.ts +3 -99
  302. package/dist/utils/dev-api.js +3 -430
  303. package/dist/utils/dev-api.js.map +1 -1
  304. package/dist/utils/dev-server.d.ts +3 -1
  305. package/dist/utils/dev-server.js +69 -145
  306. package/dist/utils/dev-server.js.map +1 -1
  307. package/dist/utils/dev-watcher.d.ts +0 -1
  308. package/dist/utils/dev-watcher.js +23 -8
  309. package/dist/utils/dev-watcher.js.map +1 -1
  310. package/dist/utils/env-loader.utils.d.ts +10 -1
  311. package/dist/utils/env-loader.utils.js +39 -31
  312. package/dist/utils/env-loader.utils.js.map +1 -1
  313. package/dist/utils/files.d.ts +47 -3
  314. package/dist/utils/files.js +98 -40
  315. package/dist/utils/files.js.map +1 -1
  316. package/dist/utils/init-agent.js +1 -2
  317. package/dist/utils/init-agent.js.map +1 -1
  318. package/dist/utils/init-helpers.d.ts +2 -10
  319. package/dist/utils/init-helpers.js +9 -17
  320. package/dist/utils/init-helpers.js.map +1 -1
  321. package/dist/utils/init-prompts.d.ts +0 -8
  322. package/dist/utils/init-prompts.js +0 -22
  323. package/dist/utils/init-prompts.js.map +1 -1
  324. package/dist/utils/prompt-handler.d.ts +3 -0
  325. package/dist/utils/prompt-handler.js +13 -0
  326. package/dist/utils/prompt-handler.js.map +1 -1
  327. package/dist/utils/sandbox-storage.d.ts +6 -5
  328. package/dist/utils/sandbox-storage.js +12 -12
  329. package/dist/utils/sandbox-storage.js.map +1 -1
  330. package/dist/utils/sandbox.d.ts +7 -30
  331. package/dist/utils/sandbox.js +247 -223
  332. package/dist/utils/sandbox.js.map +1 -1
  333. package/dist/utils/semver.d.ts +12 -0
  334. package/dist/utils/semver.js +23 -0
  335. package/dist/utils/semver.js.map +1 -1
  336. package/dist/utils/sync-display.d.ts +9 -0
  337. package/dist/utils/sync-display.js +67 -0
  338. package/dist/utils/sync-display.js.map +1 -0
  339. package/dist/utils/sync-fetch.d.ts +23 -0
  340. package/dist/utils/sync-fetch.js +64 -0
  341. package/dist/utils/sync-fetch.js.map +1 -0
  342. package/dist/utils/sync-helpers.d.ts +4 -59
  343. package/dist/utils/sync-helpers.js +4 -206
  344. package/dist/utils/sync-helpers.js.map +1 -1
  345. package/dist/web/app.css +912 -186
  346. package/dist/web/app.js +46 -46
  347. package/docs/API_INDEX.md +100 -0
  348. package/docs/API_REFERENCE.md +773 -0
  349. package/docs/CLI_REFERENCE.md +924 -0
  350. package/docs/GETTING_STARTED.md +862 -0
  351. package/docs/README.md +270 -0
  352. package/docs/api/AI.md +882 -0
  353. package/docs/api/Baskets.md +511 -0
  354. package/docs/api/CDN.md +524 -0
  355. package/docs/api/Data.md +446 -0
  356. package/docs/api/Jobs.md +524 -0
  357. package/docs/api/LuaAgent.md +454 -0
  358. package/docs/api/LuaJob.md +604 -0
  359. package/docs/api/LuaSkill.md +396 -0
  360. package/docs/api/LuaTool.md +521 -0
  361. package/docs/api/LuaWebhook.md +601 -0
  362. package/docs/api/Orders.md +514 -0
  363. package/docs/api/PostProcessor.md +565 -0
  364. package/docs/api/PreProcessor.md +630 -0
  365. package/docs/api/Products.md +507 -0
  366. package/docs/api/Templates.md +662 -0
  367. package/docs/api/User.md +567 -0
  368. package/docs/archive/DEVELOPMENT_GUIDE_V1.md +1294 -0
  369. package/docs/compiler-v2/ASSESSMENT.md +205 -0
  370. package/docs/compiler-v2/TEST_PLAN.md +306 -0
  371. package/package.json +3 -7
  372. package/template/tsconfig.json +1 -1
  373. package/dist/common/basket.instance.js.map +0 -1
  374. package/dist/common/data.entry.instance.js.map +0 -1
  375. package/dist/common/http.client.js.map +0 -1
  376. package/dist/common/job.instance.js.map +0 -1
  377. package/dist/common/order.instance.js.map +0 -1
  378. package/dist/common/product.instance.js.map +0 -1
  379. package/dist/common/product.pagination.instance.js.map +0 -1
  380. package/dist/common/product.search.instance.js.map +0 -1
  381. package/dist/common/user.instance.js.map +0 -1
  382. package/dist/config/auth.constants.d.ts +0 -11
  383. package/dist/config/auth.constants.js +0 -12
  384. package/dist/config/auth.constants.js.map +0 -1
  385. package/dist/config/init.constants.d.ts +0 -15
  386. package/dist/config/init.constants.js +0 -20
  387. package/dist/config/init.constants.js.map +0 -1
  388. package/dist/interfaces/compile.d.ts +0 -12
  389. package/dist/interfaces/compile.js +0 -5
  390. package/dist/interfaces/compile.js.map +0 -1
  391. package/dist/types/compile.types.d.ts +0 -131
  392. package/dist/types/compile.types.js +0 -6
  393. package/dist/types/compile.types.js.map +0 -1
  394. package/dist/utils/agent-code-utils.d.ts +0 -25
  395. package/dist/utils/agent-code-utils.js +0 -107
  396. package/dist/utils/agent-code-utils.js.map +0 -1
  397. package/dist/utils/bundling.d.ts +0 -89
  398. package/dist/utils/bundling.js +0 -1068
  399. package/dist/utils/bundling.js.map +0 -1
  400. package/dist/utils/compile.d.ts +0 -116
  401. package/dist/utils/compile.js +0 -1062
  402. package/dist/utils/compile.js.map +0 -1
  403. package/dist/utils/deploy-api.d.ts +0 -26
  404. package/dist/utils/deploy-api.js +0 -54
  405. package/dist/utils/deploy-api.js.map +0 -1
  406. package/dist/utils/deployment.d.ts +0 -26
  407. package/dist/utils/deployment.js +0 -218
  408. package/dist/utils/deployment.js.map +0 -1
  409. package/dist/utils/dev-helpers.d.ts +0 -47
  410. package/dist/utils/dev-helpers.js +0 -82
  411. package/dist/utils/dev-helpers.js.map +0 -1
  412. package/dist/utils/job-management.d.ts +0 -27
  413. package/dist/utils/job-management.js +0 -248
  414. package/dist/utils/job-management.js.map +0 -1
  415. package/dist/utils/mcp-server-management.d.ts +0 -26
  416. package/dist/utils/mcp-server-management.js +0 -197
  417. package/dist/utils/mcp-server-management.js.map +0 -1
  418. package/dist/utils/postprocessor-management.d.ts +0 -9
  419. package/dist/utils/postprocessor-management.js +0 -117
  420. package/dist/utils/postprocessor-management.js.map +0 -1
  421. package/dist/utils/pre-bundle-jobs.d.ts +0 -27
  422. package/dist/utils/pre-bundle-jobs.js +0 -189
  423. package/dist/utils/pre-bundle-jobs.js.map +0 -1
  424. package/dist/utils/preprocessor-management.d.ts +0 -9
  425. package/dist/utils/preprocessor-management.js +0 -117
  426. package/dist/utils/preprocessor-management.js.map +0 -1
  427. package/dist/utils/push-api.d.ts +0 -15
  428. package/dist/utils/push-api.js +0 -49
  429. package/dist/utils/push-api.js.map +0 -1
  430. package/dist/utils/push-helpers.d.ts +0 -82
  431. package/dist/utils/push-helpers.js +0 -246
  432. package/dist/utils/push-helpers.js.map +0 -1
  433. package/dist/utils/skill-management.d.ts +0 -39
  434. package/dist/utils/skill-management.js +0 -299
  435. package/dist/utils/skill-management.js.map +0 -1
  436. package/dist/utils/test-helpers.d.ts +0 -33
  437. package/dist/utils/test-helpers.js +0 -84
  438. package/dist/utils/test-helpers.js.map +0 -1
  439. package/dist/utils/test-prompts.d.ts +0 -23
  440. package/dist/utils/test-prompts.js +0 -187
  441. package/dist/utils/test-prompts.js.map +0 -1
  442. package/dist/utils/tool-detection.d.ts +0 -19
  443. package/dist/utils/tool-detection.js +0 -125
  444. package/dist/utils/tool-detection.js.map +0 -1
  445. package/dist/utils/webhook-management.d.ts +0 -27
  446. package/dist/utils/webhook-management.js +0 -241
  447. package/dist/utils/webhook-management.js.map +0 -1
  448. /package/dist/{common → api}/http.client.d.ts +0 -0
  449. /package/dist/{common → api}/http.client.js +0 -0
  450. /package/dist/{common → instances}/basket.instance.d.ts +0 -0
  451. /package/dist/{common → instances}/basket.instance.js +0 -0
  452. /package/dist/{common → instances}/data.entry.instance.d.ts +0 -0
  453. /package/dist/{common → instances}/data.entry.instance.js +0 -0
  454. /package/dist/{common → instances}/job.instance.d.ts +0 -0
  455. /package/dist/{common → instances}/job.instance.js +0 -0
  456. /package/dist/{common → instances}/order.instance.d.ts +0 -0
  457. /package/dist/{common → instances}/order.instance.js +0 -0
  458. /package/dist/{common → instances}/product.instance.d.ts +0 -0
  459. /package/dist/{common → instances}/product.instance.js +0 -0
  460. /package/dist/{common → instances}/product.pagination.instance.d.ts +0 -0
  461. /package/dist/{common → instances}/product.pagination.instance.js +0 -0
  462. /package/dist/{common → instances}/product.search.instance.d.ts +0 -0
  463. /package/dist/{common → instances}/product.search.instance.js +0 -0
  464. /package/dist/{common → instances}/user.instance.d.ts +0 -0
  465. /package/dist/{common → instances}/user.instance.js +0 -0
@@ -0,0 +1,773 @@
1
+ # Platform API Reference
2
+
3
+ Complete reference for all lua-cli runtime APIs available in your tools, webhooks, jobs, and processors.
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ When your code runs in the Lua platform (either in sandbox or production), you have access to powerful APIs for managing users, products, data, and more. These APIs are injected as globals into the VM execution environment.
10
+
11
+ **Import APIs in your code:**
12
+ ```typescript
13
+ import { User, Products, Data, Jobs, AI } from 'lua-cli';
14
+ ```
15
+
16
+ ---
17
+
18
+ ## Table of Contents
19
+
20
+ ### Core Primitives
21
+ - [LuaAgent](#luaagent) - Agent configuration
22
+ - [LuaSkill](#luaskill) - Tool collections
23
+ - [LuaTool](#luatool) - Individual tools
24
+ - [LuaWebhook](#luawebhook) - HTTP endpoints
25
+ - [LuaJob](#luajob) - Scheduled tasks
26
+ - [PreProcessor](#preprocessor) - Message preprocessing
27
+ - [PostProcessor](#postprocessor) - Response postprocessing
28
+
29
+ ### Runtime APIs
30
+ - [User API](#user-api) - User data management
31
+ - [Products API](#products-api) - Product catalog
32
+ - [Data API](#data-api) - Custom data storage
33
+ - [Baskets API](#baskets-api) - Shopping carts
34
+ - [Orders API](#orders-api) - Order management
35
+ - [Jobs API](#jobs-api) - Dynamic job creation
36
+ - [AI API](#ai-api) - AI text generation
37
+ - [Templates API](#templates-api) - WhatsApp templates
38
+ - [CDN API](#cdn-api) - File upload/download
39
+
40
+ ### Utilities
41
+ - [env()](#env) - Environment variables
42
+ - [Lua Runtime](#lua-runtime) - Request context
43
+
44
+ ---
45
+
46
+ ## Quick Reference
47
+
48
+ ### Import Everything
49
+
50
+ ```typescript
51
+ import {
52
+ // Core Primitives
53
+ LuaAgent,
54
+ LuaSkill,
55
+ LuaTool,
56
+ LuaWebhook,
57
+ LuaJob,
58
+ PreProcessor,
59
+ PostProcessor,
60
+
61
+ // Runtime APIs
62
+ User,
63
+ Products,
64
+ Baskets,
65
+ Orders,
66
+ Data,
67
+ Jobs,
68
+ AI,
69
+ Templates,
70
+ CDN,
71
+
72
+ // Utilities
73
+ env,
74
+ Lua
75
+ } from 'lua-cli';
76
+ ```
77
+
78
+ ### Common Patterns
79
+
80
+ **Create a Tool:**
81
+ ```typescript
82
+ import { LuaTool } from 'lua-cli/skill';
83
+ import { z } from 'zod';
84
+
85
+ export default class MyTool implements LuaTool {
86
+ name = 'my_tool';
87
+ description = 'Tool description';
88
+ inputSchema = z.object({ param: z.string() });
89
+
90
+ async execute(input: z.infer<typeof this.inputSchema>) {
91
+ return { result: 'success' };
92
+ }
93
+ }
94
+ ```
95
+
96
+ **Access User Data:**
97
+ ```typescript
98
+ import { User } from 'lua-cli';
99
+
100
+ const user = await User.get();
101
+ await user.update({ preferences: 'dark-mode' });
102
+ await user.send([{ type: 'text', text: 'Hello!' }]);
103
+ ```
104
+
105
+ **Use Custom Storage:**
106
+ ```typescript
107
+ import { Data } from 'lua-cli';
108
+
109
+ await Data.create('notes', { text: 'Hello' });
110
+ const notes = await Data.get('notes');
111
+ const results = await Data.search('notes', 'query');
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Core Primitives
117
+
118
+ ### LuaAgent
119
+
120
+ Unified agent configuration that combines skills, webhooks, jobs, and processors.
121
+
122
+ **Documentation:** [docs/api/LuaAgent.md](./api/LuaAgent.md)
123
+
124
+ **Quick Example:**
125
+ ```typescript
126
+ import { LuaAgent, LuaSkill } from 'lua-cli';
127
+
128
+ export const agent = new LuaAgent({
129
+ name: 'my-agent',
130
+ persona: 'You are a helpful assistant...',
131
+ skills: [skill1, skill2],
132
+ webhooks: [webhook1],
133
+ jobs: [job1],
134
+ preProcessors: [preProcessor1],
135
+ postProcessors: [postProcessor1]
136
+ });
137
+ ```
138
+
139
+ ---
140
+
141
+ ### LuaSkill
142
+
143
+ Group related tools together with shared context.
144
+
145
+ **Documentation:** [docs/api/LuaSkill.md](./api/LuaSkill.md)
146
+
147
+ **Quick Example:**
148
+ ```typescript
149
+ import { LuaSkill } from 'lua-cli';
150
+
151
+ export default new LuaSkill({
152
+ name: 'weather-skill',
153
+ description: 'Weather information tools',
154
+ context: 'Use these tools to get weather data',
155
+ tools: [tool1, tool2]
156
+ });
157
+ ```
158
+
159
+ ---
160
+
161
+ ### LuaTool
162
+
163
+ Individual function your agent can call.
164
+
165
+ **Documentation:** [docs/api/LuaTool.md](./api/LuaTool.md)
166
+
167
+ **Quick Example:**
168
+ ```typescript
169
+ import { LuaTool } from 'lua-cli/skill';
170
+ import { z } from 'zod';
171
+
172
+ export default class GetWeatherTool implements LuaTool {
173
+ name = 'get_weather';
174
+ description = 'Get current weather';
175
+
176
+ inputSchema = z.object({
177
+ city: z.string()
178
+ });
179
+
180
+ async execute(input) {
181
+ return { temperature: 72, condition: 'sunny' };
182
+ }
183
+ }
184
+ ```
185
+
186
+ ---
187
+
188
+ ### LuaWebhook
189
+
190
+ HTTP endpoint for external integrations.
191
+
192
+ **Documentation:** [docs/api/LuaWebhook.md](./api/LuaWebhook.md)
193
+
194
+ **Quick Example:**
195
+ ```typescript
196
+ import { LuaWebhook } from 'lua-cli';
197
+ import { z } from 'zod';
198
+
199
+ export default new LuaWebhook({
200
+ name: 'payment-webhook',
201
+ description: 'Handle payment notifications',
202
+
203
+ bodySchema: z.object({
204
+ orderId: z.string(),
205
+ amount: z.number()
206
+ }),
207
+
208
+ execute: async ({ body, headers, query }) => {
209
+ return { status: 200, body: { received: true } };
210
+ }
211
+ });
212
+ ```
213
+
214
+ ---
215
+
216
+ ### LuaJob
217
+
218
+ Scheduled task that runs automatically.
219
+
220
+ **Documentation:** [docs/api/LuaJob.md](./api/LuaJob.md)
221
+
222
+ **Quick Example:**
223
+ ```typescript
224
+ import { LuaJob } from 'lua-cli';
225
+
226
+ export default new LuaJob({
227
+ name: 'daily-cleanup',
228
+ description: 'Clean up old data',
229
+
230
+ schedule: {
231
+ type: 'cron',
232
+ pattern: '0 0 * * *' // Midnight daily
233
+ },
234
+
235
+ execute: async (job) => {
236
+ return { success: true, deleted: 42 };
237
+ }
238
+ });
239
+ ```
240
+
241
+ ---
242
+
243
+ ### PreProcessor
244
+
245
+ Filter or modify messages before they reach your agent.
246
+
247
+ **Documentation:** [docs/api/PreProcessor.md](./api/PreProcessor.md)
248
+
249
+ **Quick Example:**
250
+ ```typescript
251
+ import { PreProcessor } from 'lua-cli';
252
+
253
+ export default new PreProcessor({
254
+ name: 'spam-filter',
255
+ description: 'Block spam messages',
256
+
257
+ execute: async (message) => {
258
+ if (message.text.includes('spam')) {
259
+ return { action: 'BLOCK' };
260
+ }
261
+ return { action: 'PROCEED' };
262
+ }
263
+ });
264
+ ```
265
+
266
+ ---
267
+
268
+ ### PostProcessor
269
+
270
+ Transform or format agent responses.
271
+
272
+ **Documentation:** [docs/api/PostProcessor.md](./api/PostProcessor.md)
273
+
274
+ **Quick Example:**
275
+ ```typescript
276
+ import { PostProcessor } from 'lua-cli';
277
+
278
+ export default new PostProcessor({
279
+ name: 'response-formatter',
280
+ description: 'Format responses',
281
+
282
+ execute: async (response) => {
283
+ return response.toUpperCase() + ' 🎉';
284
+ }
285
+ });
286
+ ```
287
+
288
+ ---
289
+
290
+ ## Runtime APIs
291
+
292
+ ### User API
293
+
294
+ Access and manage user data.
295
+
296
+ **Documentation:** [docs/api/User.md](./api/User.md)
297
+
298
+ **Methods:**
299
+ - `User.get()` - Get current user
300
+ - `user.update(data)` - Update user data
301
+ - `user.send(messages)` - Send messages to user
302
+ - `user.getChatHistory()` - Get conversation history
303
+
304
+ **Example:**
305
+ ```typescript
306
+ import { User } from 'lua-cli';
307
+
308
+ const user = await User.get();
309
+ console.log(user.name, user.email);
310
+
311
+ await user.update({ preferences: 'dark-mode' });
312
+
313
+ await user.send([
314
+ { type: 'text', text: 'Hello!' },
315
+ { type: 'image', url: 'https://example.com/image.jpg' }
316
+ ]);
317
+
318
+ const history = await user.getChatHistory();
319
+ ```
320
+
321
+ ---
322
+
323
+ ### Products API
324
+
325
+ Manage product catalog.
326
+
327
+ **Documentation:** [docs/api/Products.md](./api/Products.md)
328
+
329
+ **Methods:**
330
+ - `Products.get(filter?)` - List products
331
+ - `Products.getById(id)` - Get single product
332
+ - `Products.search(query, filter?)` - Search products
333
+ - `Products.create(data)` - Create product
334
+ - `product.update(data)` - Update product
335
+ - `product.delete()` - Delete product
336
+
337
+ **Example:**
338
+ ```typescript
339
+ import { Products } from 'lua-cli';
340
+
341
+ // List all products
342
+ const products = await Products.get();
343
+
344
+ // Search products
345
+ const results = await Products.search('laptop', {
346
+ category: 'electronics',
347
+ inStock: true
348
+ });
349
+
350
+ // Create product
351
+ const product = await Products.create({
352
+ name: 'MacBook Pro',
353
+ price: 2499,
354
+ category: 'electronics',
355
+ stock: 10
356
+ });
357
+
358
+ // Update
359
+ await product.update({ price: 2299 });
360
+
361
+ // Delete
362
+ await product.delete();
363
+ ```
364
+
365
+ ---
366
+
367
+ ### Data API
368
+
369
+ Custom data storage with vector search.
370
+
371
+ **Documentation:** [docs/api/Data.md](./api/Data.md)
372
+
373
+ **Methods:**
374
+ - `Data.get(collection, filter?)` - List entries
375
+ - `Data.getEntry(collection, id)` - Get single entry
376
+ - `Data.search(collection, query)` - Vector search
377
+ - `Data.create(collection, data)` - Create entry
378
+ - `entry.update(data)` - Update entry
379
+ - `entry.delete()` - Delete entry
380
+
381
+ **Example:**
382
+ ```typescript
383
+ import { Data } from 'lua-cli';
384
+
385
+ // Create
386
+ await Data.create('notes', {
387
+ title: 'Meeting Notes',
388
+ content: 'Discussed Q1 roadmap...',
389
+ tags: ['meeting', 'planning']
390
+ });
391
+
392
+ // List
393
+ const notes = await Data.get('notes', { tags: 'meeting' });
394
+
395
+ // Search (vector similarity)
396
+ const results = await Data.search('notes', 'roadmap planning');
397
+
398
+ // Update
399
+ const entry = await Data.getEntry('notes', 'entry-id');
400
+ await entry.update({ title: 'Updated Title' });
401
+
402
+ // Delete
403
+ await entry.delete();
404
+ ```
405
+
406
+ ---
407
+
408
+ ### Baskets API
409
+
410
+ Shopping cart management.
411
+
412
+ **Documentation:** [docs/api/Baskets.md](./api/Baskets.md)
413
+
414
+ **Methods:**
415
+ - `Baskets.get()` - List baskets
416
+ - `Baskets.create()` - Create basket
417
+ - `Baskets.getById(id)` - Get basket
418
+ - `basket.addItem(item)` - Add item
419
+ - `basket.removeItem(productId)` - Remove item
420
+ - `basket.clear()` - Clear basket
421
+ - `basket.placeOrder()` - Convert to order
422
+
423
+ **Example:**
424
+ ```typescript
425
+ import { Baskets } from 'lua-cli';
426
+
427
+ // Create basket
428
+ const basket = await Baskets.create();
429
+
430
+ // Add items
431
+ await basket.addItem({
432
+ productId: 'prod-123',
433
+ quantity: 2,
434
+ price: 29.99
435
+ });
436
+
437
+ // Place order
438
+ const order = await basket.placeOrder();
439
+ ```
440
+
441
+ ---
442
+
443
+ ### Orders API
444
+
445
+ Order management and fulfillment.
446
+
447
+ **Documentation:** [docs/api/Orders.md](./api/Orders.md)
448
+
449
+ **Methods:**
450
+ - `Orders.get(filter?)` - List orders
451
+ - `Orders.getById(id)` - Get order
452
+ - `Orders.create(data)` - Create order
453
+ - `Orders.updateStatus(status, orderId)` - Update status
454
+ - `order.updateData(data)` - Update order data
455
+
456
+ **Example:**
457
+ ```typescript
458
+ import { Orders } from 'lua-cli';
459
+
460
+ // List orders
461
+ const orders = await Orders.get({ status: 'pending' });
462
+
463
+ // Update status
464
+ await Orders.updateStatus('confirmed', 'order-123');
465
+
466
+ // Get order
467
+ const order = await Orders.getById('order-123');
468
+ console.log(order.items, order.total, order.status);
469
+ ```
470
+
471
+ ---
472
+
473
+ ### Jobs API
474
+
475
+ Create jobs dynamically from tools.
476
+
477
+ **Documentation:** [docs/api/Jobs.md](./api/Jobs.md)
478
+
479
+ **Methods:**
480
+ - `Jobs.create(config)` - Create job
481
+ - `Jobs.getJob(jobId)` - Get job
482
+ - `Jobs.getAll()` - List all jobs
483
+ - `job.user()` - Get job's user
484
+ - `job.delete()` - Delete job
485
+
486
+ **Example:**
487
+ ```typescript
488
+ import { Jobs } from 'lua-cli';
489
+
490
+ // Create reminder job
491
+ const job = await Jobs.create({
492
+ name: 'remind-user',
493
+ metadata: { message: 'Meeting in 1 hour' },
494
+ schedule: {
495
+ type: 'once',
496
+ executeAt: new Date(Date.now() + 3600000)
497
+ },
498
+ execute: async (job) => {
499
+ const user = await job.user();
500
+ await user.send([{
501
+ type: 'text',
502
+ text: job.metadata.message
503
+ }]);
504
+ return { success: true };
505
+ }
506
+ });
507
+ ```
508
+
509
+ ---
510
+
511
+ ### AI API
512
+
513
+ Generate AI text responses.
514
+
515
+ **Documentation:** [docs/api/AI.md](./api/AI.md)
516
+
517
+ **Methods:**
518
+ - `AI.generate(prompt, options?)` - Generate text
519
+
520
+ **Example:**
521
+ ```typescript
522
+ import { AI } from 'lua-cli';
523
+
524
+ const response = await AI.generate('Summarize this text: ...', {
525
+ maxTokens: 100,
526
+ temperature: 0.7
527
+ });
528
+
529
+ console.log(response.text);
530
+ ```
531
+
532
+ ---
533
+
534
+ ### Templates API
535
+
536
+ Send WhatsApp template messages.
537
+
538
+ **Documentation:** [docs/api/Templates.md](./api/Templates.md)
539
+
540
+ **Methods:**
541
+ - `Templates.whatsapp.list()` - List templates
542
+ - `Templates.whatsapp.get(name)` - Get template
543
+ - `Templates.whatsapp.send(config)` - Send template
544
+
545
+ **Example:**
546
+ ```typescript
547
+ import { Templates } from 'lua-cli';
548
+
549
+ const templates = await Templates.whatsapp.list();
550
+
551
+ await Templates.whatsapp.send({
552
+ templateName: 'order_confirmation',
553
+ to: '+1234567890',
554
+ parameters: {
555
+ order_id: '12345',
556
+ amount: '$99.99'
557
+ }
558
+ });
559
+ ```
560
+
561
+ ---
562
+
563
+ ### CDN API
564
+
565
+ Upload and download files.
566
+
567
+ **Documentation:** [docs/api/CDN.md](./api/CDN.md)
568
+
569
+ **Methods:**
570
+ - `CDN.upload(file, options)` - Upload file
571
+ - `CDN.get(fileId)` - Get file URL
572
+
573
+ **Example:**
574
+ ```typescript
575
+ import { CDN } from 'lua-cli';
576
+
577
+ const result = await CDN.upload(fileBuffer, {
578
+ filename: 'report.pdf',
579
+ contentType: 'application/pdf'
580
+ });
581
+
582
+ const url = await CDN.get(result.fileId);
583
+ ```
584
+
585
+ ---
586
+
587
+ ## Utilities
588
+
589
+ ### env()
590
+
591
+ Access environment variables.
592
+
593
+ **Usage:**
594
+ ```typescript
595
+ import { env } from 'lua-cli';
596
+
597
+ const apiKey = env('OPENAI_API_KEY');
598
+ const baseUrl = env('BASE_URL') || 'https://api.example.com';
599
+ ```
600
+
601
+ **Setting Environment Variables:**
602
+ ```bash
603
+ # Via CLI
604
+ lua env set OPENAI_API_KEY sk-...
605
+
606
+ # Via .env file (local only)
607
+ OPENAI_API_KEY=sk-...
608
+ ```
609
+
610
+ ---
611
+
612
+ ### Lua Runtime
613
+
614
+ Access request context information.
615
+
616
+ **Usage:**
617
+ ```typescript
618
+ import { Lua } from 'lua-cli';
619
+
620
+ if (Lua.request.channel === 'whatsapp') {
621
+ // WhatsApp-specific logic
622
+ }
623
+
624
+ if (Lua.request.webhook) {
625
+ // Running in webhook context
626
+ console.log('Webhook:', Lua.request.webhook.name);
627
+ }
628
+ ```
629
+
630
+ **Properties:**
631
+ - `Lua.request.channel` - Channel type (`'whatsapp'`, `'web'`, `'api'`)
632
+ - `Lua.request.webhook` - Webhook info (if running in webhook)
633
+
634
+ ---
635
+
636
+ ## Type Definitions
637
+
638
+ ### Instance Classes
639
+
640
+ These are returned by API calls and provide instance methods:
641
+
642
+ | Instance | Methods | Description |
643
+ |----------|---------|-------------|
644
+ | `UserDataInstance` | `update()`, `send()`, `save()` | User with data access |
645
+ | `ProductInstance` | `update()`, `delete()`, `save()` | Product with CRUD |
646
+ | `BasketInstance` | `addItem()`, `removeItem()`, `placeOrder()` | Shopping cart |
647
+ | `OrderInstance` | `updateStatus()`, `updateData()` | Order management |
648
+ | `DataEntryInstance` | `update()`, `delete()`, `save()` | Custom data entry |
649
+ | `JobInstance` | `user()`, `delete()` | Job with metadata |
650
+
651
+ ### Enums
652
+
653
+ ```typescript
654
+ // Basket status
655
+ enum BasketStatus {
656
+ ACTIVE = 'ACTIVE',
657
+ CHECKED_OUT = 'CHECKED_OUT',
658
+ ABANDONED = 'ABANDONED',
659
+ EXPIRED = 'EXPIRED'
660
+ }
661
+
662
+ // Order status
663
+ enum OrderStatus {
664
+ PENDING = 'PENDING',
665
+ CONFIRMED = 'CONFIRMED',
666
+ FULFILLED = 'FULFILLED',
667
+ CANCELLED = 'CANCELLED'
668
+ }
669
+ ```
670
+
671
+ ---
672
+
673
+ ## Complete API Index
674
+
675
+ | API | Purpose | Key Methods |
676
+ |-----|---------|-------------|
677
+ | [User](./api/User.md) | User data | `get()`, `update()`, `send()` |
678
+ | [Products](./api/Products.md) | Product catalog | `get()`, `search()`, `create()` |
679
+ | [Data](./api/Data.md) | Custom storage | `get()`, `search()`, `create()` |
680
+ | [Baskets](./api/Baskets.md) | Shopping carts | `create()`, `addItem()`, `placeOrder()` |
681
+ | [Orders](./api/Orders.md) | Order management | `get()`, `updateStatus()` |
682
+ | [Jobs](./api/Jobs.md) | Dynamic jobs | `create()`, `getAll()` |
683
+ | [AI](./api/AI.md) | AI generation | `generate()` |
684
+ | [Templates](./api/Templates.md) | WhatsApp templates | `list()`, `send()` |
685
+ | [CDN](./api/CDN.md) | File storage | `upload()`, `get()` |
686
+
687
+ ---
688
+
689
+ ## Usage by Category
690
+
691
+ ### Building an Agent
692
+ 1. [LuaAgent](./api/LuaAgent.md) - Configure agent
693
+ 2. [LuaSkill](./api/LuaSkill.md) - Organize tools
694
+ 3. [LuaTool](./api/LuaTool.md) - Create tools
695
+
696
+ ### E-commerce
697
+ 1. [Products API](./api/Products.md) - Manage catalog
698
+ 2. [Baskets API](./api/Baskets.md) - Shopping carts
699
+ 3. [Orders API](./api/Orders.md) - Process orders
700
+
701
+ ### Automation
702
+ 1. [LuaJob](./api/LuaJob.md) - Scheduled tasks
703
+ 2. [Jobs API](./api/Jobs.md) - Dynamic jobs
704
+ 3. [LuaWebhook](./api/LuaWebhook.md) - HTTP triggers
705
+
706
+ ### Data Management
707
+ 1. [User API](./api/User.md) - User data
708
+ 2. [Data API](./api/Data.md) - Custom storage
709
+ 3. [CDN API](./api/CDN.md) - File storage
710
+
711
+ ---
712
+
713
+ ## Best Practices
714
+
715
+ ### Error Handling
716
+
717
+ Always wrap API calls in try-catch:
718
+ ```typescript
719
+ try {
720
+ const user = await User.get();
721
+ await user.send([{ type: 'text', text: 'Hello!' }]);
722
+ } catch (error) {
723
+ console.error('Failed to send message:', error);
724
+ return { error: error.message };
725
+ }
726
+ ```
727
+
728
+ ### Type Safety
729
+
730
+ Use TypeScript types for better IDE support:
731
+ ```typescript
732
+ import { UserDataInstance, ProductInstance } from 'lua-cli';
733
+
734
+ const user: UserDataInstance = await User.get();
735
+ const product: ProductInstance = await Products.getById('prod-123');
736
+ ```
737
+
738
+ ### Environment Variables
739
+
740
+ Never hardcode secrets:
741
+ ```typescript
742
+ // ❌ Bad
743
+ const apiKey = 'sk-1234567890';
744
+
745
+ // ✅ Good
746
+ import { env } from 'lua-cli';
747
+ const apiKey = env('OPENAI_API_KEY');
748
+ ```
749
+
750
+ ### Async/Await
751
+
752
+ All API calls are async:
753
+ ```typescript
754
+ // ❌ Bad (missing await)
755
+ const user = User.get();
756
+
757
+ // ✅ Good
758
+ const user = await User.get();
759
+ ```
760
+
761
+ ---
762
+
763
+ ## See Also
764
+
765
+ - [Getting Started Guide](./GETTING_STARTED.md) - Step-by-step tutorial
766
+ - [CLI Reference](./CLI_REFERENCE.md) - All commands
767
+ - [Main README](../README.md) - Project overview
768
+ - [API Index](./API_INDEX.md) - Quick reference table
769
+
770
+ ---
771
+
772
+ **Version:** 3.5.0-alpha.3
773
+ **Last Updated:** February 2026