lua-cli 3.15.3 → 3.16.2

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 (834) hide show
  1. package/dist/api-exports.d.ts +5029 -698
  2. package/dist/api-exports.js +6509 -772
  3. package/dist/api-exports.js.map +1 -1
  4. package/dist/index.d.ts +0 -1
  5. package/dist/index.js +41667 -82
  6. package/dist/index.js.map +1 -1
  7. package/dist/voice/test/index.d.ts +1217 -0
  8. package/dist/voice/test/index.js +386 -0
  9. package/dist/voice/test/index.js.map +1 -0
  10. package/dist/voice-exports.d.ts +40 -0
  11. package/dist/voice-exports.js +16 -0
  12. package/dist/voice-exports.js.map +1 -0
  13. package/docs/README.md +2 -2
  14. package/package.json +38 -21
  15. package/scripts/build-vendor.mjs +6 -3
  16. package/scripts/run-api-extractor.mjs +79 -0
  17. package/template/.gitignore +21 -0
  18. package/template/package.json +1 -1
  19. package/dist/api/agent.api.service.d.ts +0 -165
  20. package/dist/api/agent.api.service.d.ts.map +0 -1
  21. package/dist/api/agent.api.service.js +0 -207
  22. package/dist/api/agent.api.service.js.map +0 -1
  23. package/dist/api/agents.api.service.d.ts +0 -21
  24. package/dist/api/agents.api.service.d.ts.map +0 -1
  25. package/dist/api/agents.api.service.js +0 -51
  26. package/dist/api/agents.api.service.js.map +0 -1
  27. package/dist/api/ai.api.service.d.ts +0 -20
  28. package/dist/api/ai.api.service.d.ts.map +0 -1
  29. package/dist/api/ai.api.service.js +0 -40
  30. package/dist/api/ai.api.service.js.map +0 -1
  31. package/dist/api/auth.api.service.d.ts +0 -49
  32. package/dist/api/auth.api.service.d.ts.map +0 -1
  33. package/dist/api/auth.api.service.js +0 -55
  34. package/dist/api/auth.api.service.js.map +0 -1
  35. package/dist/api/backup.api.service.d.ts +0 -78
  36. package/dist/api/backup.api.service.d.ts.map +0 -1
  37. package/dist/api/backup.api.service.js +0 -115
  38. package/dist/api/backup.api.service.js.map +0 -1
  39. package/dist/api/basket.api.service.d.ts +0 -85
  40. package/dist/api/basket.api.service.d.ts.map +0 -1
  41. package/dist/api/basket.api.service.js +0 -160
  42. package/dist/api/basket.api.service.js.map +0 -1
  43. package/dist/api/cdn.api.service.d.ts +0 -21
  44. package/dist/api/cdn.api.service.d.ts.map +0 -1
  45. package/dist/api/cdn.api.service.js +0 -46
  46. package/dist/api/cdn.api.service.js.map +0 -1
  47. package/dist/api/chat.api.service.d.ts +0 -40
  48. package/dist/api/chat.api.service.d.ts.map +0 -1
  49. package/dist/api/chat.api.service.js +0 -121
  50. package/dist/api/chat.api.service.js.map +0 -1
  51. package/dist/api/credentials.d.ts +0 -25
  52. package/dist/api/credentials.d.ts.map +0 -1
  53. package/dist/api/credentials.js +0 -44
  54. package/dist/api/credentials.js.map +0 -1
  55. package/dist/api/custom.data.api.service.d.ts +0 -71
  56. package/dist/api/custom.data.api.service.d.ts.map +0 -1
  57. package/dist/api/custom.data.api.service.js +0 -126
  58. package/dist/api/custom.data.api.service.js.map +0 -1
  59. package/dist/api/developer.api.service.d.ts +0 -121
  60. package/dist/api/developer.api.service.d.ts.map +0 -1
  61. package/dist/api/developer.api.service.js +0 -162
  62. package/dist/api/developer.api.service.js.map +0 -1
  63. package/dist/api/device-trigger.api.service.d.ts +0 -136
  64. package/dist/api/device-trigger.api.service.d.ts.map +0 -1
  65. package/dist/api/device-trigger.api.service.js +0 -120
  66. package/dist/api/device-trigger.api.service.js.map +0 -1
  67. package/dist/api/device.api.service.d.ts +0 -61
  68. package/dist/api/device.api.service.d.ts.map +0 -1
  69. package/dist/api/device.api.service.js +0 -72
  70. package/dist/api/device.api.service.js.map +0 -1
  71. package/dist/api/http.client.d.ts +0 -90
  72. package/dist/api/http.client.d.ts.map +0 -1
  73. package/dist/api/http.client.js +0 -265
  74. package/dist/api/http.client.js.map +0 -1
  75. package/dist/api/job.api.service.d.ts +0 -154
  76. package/dist/api/job.api.service.d.ts.map +0 -1
  77. package/dist/api/job.api.service.js +0 -230
  78. package/dist/api/job.api.service.js.map +0 -1
  79. package/dist/api/lazy-instances.d.ts +0 -107
  80. package/dist/api/lazy-instances.d.ts.map +0 -1
  81. package/dist/api/lazy-instances.js +0 -220
  82. package/dist/api/lazy-instances.js.map +0 -1
  83. package/dist/api/logs.api.service.d.ts +0 -38
  84. package/dist/api/logs.api.service.d.ts.map +0 -1
  85. package/dist/api/logs.api.service.js +0 -50
  86. package/dist/api/logs.api.service.js.map +0 -1
  87. package/dist/api/marketplace.api.service.d.ts +0 -28
  88. package/dist/api/marketplace.api.service.d.ts.map +0 -1
  89. package/dist/api/marketplace.api.service.js +0 -112
  90. package/dist/api/marketplace.api.service.js.map +0 -1
  91. package/dist/api/order.api.service.d.ts +0 -53
  92. package/dist/api/order.api.service.d.ts.map +0 -1
  93. package/dist/api/order.api.service.js +0 -94
  94. package/dist/api/order.api.service.js.map +0 -1
  95. package/dist/api/persona.api.service.d.ts +0 -56
  96. package/dist/api/persona.api.service.d.ts.map +0 -1
  97. package/dist/api/persona.api.service.js +0 -90
  98. package/dist/api/persona.api.service.js.map +0 -1
  99. package/dist/api/postprocessor.api.service.d.ts +0 -151
  100. package/dist/api/postprocessor.api.service.d.ts.map +0 -1
  101. package/dist/api/postprocessor.api.service.js +0 -109
  102. package/dist/api/postprocessor.api.service.js.map +0 -1
  103. package/dist/api/preprocessor.api.service.d.ts +0 -155
  104. package/dist/api/preprocessor.api.service.d.ts.map +0 -1
  105. package/dist/api/preprocessor.api.service.js +0 -111
  106. package/dist/api/preprocessor.api.service.js.map +0 -1
  107. package/dist/api/products.api.service.d.ts +0 -80
  108. package/dist/api/products.api.service.d.ts.map +0 -1
  109. package/dist/api/products.api.service.js +0 -126
  110. package/dist/api/products.api.service.js.map +0 -1
  111. package/dist/api/resource.api.service.d.ts +0 -77
  112. package/dist/api/resource.api.service.d.ts.map +0 -1
  113. package/dist/api/resource.api.service.js +0 -74
  114. package/dist/api/resource.api.service.js.map +0 -1
  115. package/dist/api/skills.api.service.d.ts +0 -94
  116. package/dist/api/skills.api.service.d.ts.map +0 -1
  117. package/dist/api/skills.api.service.js +0 -120
  118. package/dist/api/skills.api.service.js.map +0 -1
  119. package/dist/api/tool.api.service.d.ts +0 -53
  120. package/dist/api/tool.api.service.d.ts.map +0 -1
  121. package/dist/api/tool.api.service.js +0 -74
  122. package/dist/api/tool.api.service.js.map +0 -1
  123. package/dist/api/unifiedto.api.service.d.ts +0 -133
  124. package/dist/api/unifiedto.api.service.d.ts.map +0 -1
  125. package/dist/api/unifiedto.api.service.js +0 -166
  126. package/dist/api/unifiedto.api.service.js.map +0 -1
  127. package/dist/api/user.data.api.service.d.ts +0 -69
  128. package/dist/api/user.data.api.service.d.ts.map +0 -1
  129. package/dist/api/user.data.api.service.js +0 -158
  130. package/dist/api/user.data.api.service.js.map +0 -1
  131. package/dist/api/webhook.api.service.d.ts +0 -163
  132. package/dist/api/webhook.api.service.d.ts.map +0 -1
  133. package/dist/api/webhook.api.service.js +0 -140
  134. package/dist/api/webhook.api.service.js.map +0 -1
  135. package/dist/api/whatsapp-templates.api.service.d.ts +0 -41
  136. package/dist/api/whatsapp-templates.api.service.d.ts.map +0 -1
  137. package/dist/api/whatsapp-templates.api.service.js +0 -79
  138. package/dist/api/whatsapp-templates.api.service.js.map +0 -1
  139. package/dist/api-exports.d.ts.map +0 -1
  140. package/dist/cli/command-definitions.d.ts +0 -29
  141. package/dist/cli/command-definitions.d.ts.map +0 -1
  142. package/dist/cli/command-definitions.js +0 -943
  143. package/dist/cli/command-definitions.js.map +0 -1
  144. package/dist/commands/admin.d.ts +0 -24
  145. package/dist/commands/admin.d.ts.map +0 -1
  146. package/dist/commands/admin.js +0 -44
  147. package/dist/commands/admin.js.map +0 -1
  148. package/dist/commands/agents.d.ts +0 -23
  149. package/dist/commands/agents.d.ts.map +0 -1
  150. package/dist/commands/agents.js +0 -83
  151. package/dist/commands/agents.js.map +0 -1
  152. package/dist/commands/apiKey.d.ts +0 -8
  153. package/dist/commands/apiKey.d.ts.map +0 -1
  154. package/dist/commands/apiKey.js +0 -43
  155. package/dist/commands/apiKey.js.map +0 -1
  156. package/dist/commands/channels.d.ts +0 -13
  157. package/dist/commands/channels.d.ts.map +0 -1
  158. package/dist/commands/channels.js +0 -747
  159. package/dist/commands/channels.js.map +0 -1
  160. package/dist/commands/chat-log-probe.d.ts +0 -59
  161. package/dist/commands/chat-log-probe.d.ts.map +0 -1
  162. package/dist/commands/chat-log-probe.js +0 -87
  163. package/dist/commands/chat-log-probe.js.map +0 -1
  164. package/dist/commands/chat.d.ts +0 -20
  165. package/dist/commands/chat.d.ts.map +0 -1
  166. package/dist/commands/chat.js +0 -618
  167. package/dist/commands/chat.js.map +0 -1
  168. package/dist/commands/chatClear.d.ts +0 -25
  169. package/dist/commands/chatClear.d.ts.map +0 -1
  170. package/dist/commands/chatClear.js +0 -71
  171. package/dist/commands/chatClear.js.map +0 -1
  172. package/dist/commands/compile.d.ts +0 -48
  173. package/dist/commands/compile.d.ts.map +0 -1
  174. package/dist/commands/compile.js +0 -216
  175. package/dist/commands/compile.js.map +0 -1
  176. package/dist/commands/completion.d.ts +0 -12
  177. package/dist/commands/completion.d.ts.map +0 -1
  178. package/dist/commands/completion.js +0 -211
  179. package/dist/commands/completion.js.map +0 -1
  180. package/dist/commands/configure.d.ts +0 -42
  181. package/dist/commands/configure.d.ts.map +0 -1
  182. package/dist/commands/configure.js +0 -76
  183. package/dist/commands/configure.js.map +0 -1
  184. package/dist/commands/deploy.d.ts +0 -14
  185. package/dist/commands/deploy.d.ts.map +0 -1
  186. package/dist/commands/deploy.js +0 -517
  187. package/dist/commands/deploy.js.map +0 -1
  188. package/dist/commands/destroy.d.ts +0 -8
  189. package/dist/commands/destroy.d.ts.map +0 -1
  190. package/dist/commands/destroy.js +0 -66
  191. package/dist/commands/destroy.js.map +0 -1
  192. package/dist/commands/devices.d.ts +0 -6
  193. package/dist/commands/devices.d.ts.map +0 -1
  194. package/dist/commands/devices.js +0 -265
  195. package/dist/commands/devices.js.map +0 -1
  196. package/dist/commands/docs.d.ts +0 -20
  197. package/dist/commands/docs.d.ts.map +0 -1
  198. package/dist/commands/docs.js +0 -33
  199. package/dist/commands/docs.js.map +0 -1
  200. package/dist/commands/env.d.ts +0 -34
  201. package/dist/commands/env.d.ts.map +0 -1
  202. package/dist/commands/env.js +0 -612
  203. package/dist/commands/env.js.map +0 -1
  204. package/dist/commands/evals.d.ts +0 -9
  205. package/dist/commands/evals.d.ts.map +0 -1
  206. package/dist/commands/evals.js +0 -27
  207. package/dist/commands/evals.js.map +0 -1
  208. package/dist/commands/features.d.ts +0 -13
  209. package/dist/commands/features.d.ts.map +0 -1
  210. package/dist/commands/features.js +0 -455
  211. package/dist/commands/features.js.map +0 -1
  212. package/dist/commands/governance.d.ts +0 -7
  213. package/dist/commands/governance.d.ts.map +0 -1
  214. package/dist/commands/governance.js +0 -258
  215. package/dist/commands/governance.js.map +0 -1
  216. package/dist/commands/index.d.ts +0 -38
  217. package/dist/commands/index.d.ts.map +0 -1
  218. package/dist/commands/index.js +0 -38
  219. package/dist/commands/index.js.map +0 -1
  220. package/dist/commands/init.d.ts +0 -53
  221. package/dist/commands/init.d.ts.map +0 -1
  222. package/dist/commands/init.js +0 -992
  223. package/dist/commands/init.js.map +0 -1
  224. package/dist/commands/integrations.d.ts +0 -18
  225. package/dist/commands/integrations.d.ts.map +0 -1
  226. package/dist/commands/integrations.js +0 -2666
  227. package/dist/commands/integrations.js.map +0 -1
  228. package/dist/commands/jobs.d.ts +0 -13
  229. package/dist/commands/jobs.d.ts.map +0 -1
  230. package/dist/commands/jobs.js +0 -736
  231. package/dist/commands/jobs.js.map +0 -1
  232. package/dist/commands/log-tip.d.ts +0 -79
  233. package/dist/commands/log-tip.d.ts.map +0 -1
  234. package/dist/commands/log-tip.js +0 -83
  235. package/dist/commands/log-tip.js.map +0 -1
  236. package/dist/commands/logs.d.ts +0 -13
  237. package/dist/commands/logs.d.ts.map +0 -1
  238. package/dist/commands/logs.js +0 -493
  239. package/dist/commands/logs.js.map +0 -1
  240. package/dist/commands/marketplace.d.ts +0 -34
  241. package/dist/commands/marketplace.d.ts.map +0 -1
  242. package/dist/commands/marketplace.js +0 -2105
  243. package/dist/commands/marketplace.js.map +0 -1
  244. package/dist/commands/mcp.d.ts +0 -32
  245. package/dist/commands/mcp.d.ts.map +0 -1
  246. package/dist/commands/mcp.js +0 -395
  247. package/dist/commands/mcp.js.map +0 -1
  248. package/dist/commands/models.d.ts +0 -18
  249. package/dist/commands/models.d.ts.map +0 -1
  250. package/dist/commands/models.js +0 -207
  251. package/dist/commands/models.js.map +0 -1
  252. package/dist/commands/persona.d.ts +0 -13
  253. package/dist/commands/persona.d.ts.map +0 -1
  254. package/dist/commands/persona.js +0 -560
  255. package/dist/commands/persona.js.map +0 -1
  256. package/dist/commands/postprocessors.d.ts +0 -13
  257. package/dist/commands/postprocessors.d.ts.map +0 -1
  258. package/dist/commands/postprocessors.js +0 -558
  259. package/dist/commands/postprocessors.js.map +0 -1
  260. package/dist/commands/preprocessors.d.ts +0 -13
  261. package/dist/commands/preprocessors.d.ts.map +0 -1
  262. package/dist/commands/preprocessors.js +0 -558
  263. package/dist/commands/preprocessors.js.map +0 -1
  264. package/dist/commands/production.d.ts +0 -13
  265. package/dist/commands/production.d.ts.map +0 -1
  266. package/dist/commands/production.js +0 -588
  267. package/dist/commands/production.js.map +0 -1
  268. package/dist/commands/push-helpers.d.ts +0 -42
  269. package/dist/commands/push-helpers.d.ts.map +0 -1
  270. package/dist/commands/push-helpers.js +0 -48
  271. package/dist/commands/push-helpers.js.map +0 -1
  272. package/dist/commands/push.d.ts +0 -31
  273. package/dist/commands/push.d.ts.map +0 -1
  274. package/dist/commands/push.js +0 -1262
  275. package/dist/commands/push.js.map +0 -1
  276. package/dist/commands/pushBackup.d.ts +0 -78
  277. package/dist/commands/pushBackup.d.ts.map +0 -1
  278. package/dist/commands/pushBackup.js +0 -274
  279. package/dist/commands/pushBackup.js.map +0 -1
  280. package/dist/commands/resources.d.ts +0 -13
  281. package/dist/commands/resources.d.ts.map +0 -1
  282. package/dist/commands/resources.js +0 -377
  283. package/dist/commands/resources.js.map +0 -1
  284. package/dist/commands/skills.d.ts +0 -13
  285. package/dist/commands/skills.d.ts.map +0 -1
  286. package/dist/commands/skills.js +0 -618
  287. package/dist/commands/skills.js.map +0 -1
  288. package/dist/commands/source.d.ts +0 -72
  289. package/dist/commands/source.d.ts.map +0 -1
  290. package/dist/commands/source.js +0 -134
  291. package/dist/commands/source.js.map +0 -1
  292. package/dist/commands/status.d.ts +0 -14
  293. package/dist/commands/status.d.ts.map +0 -1
  294. package/dist/commands/status.js +0 -731
  295. package/dist/commands/status.js.map +0 -1
  296. package/dist/commands/sync.d.ts +0 -28
  297. package/dist/commands/sync.d.ts.map +0 -1
  298. package/dist/commands/sync.js +0 -802
  299. package/dist/commands/sync.js.map +0 -1
  300. package/dist/commands/telemetry.d.ts +0 -6
  301. package/dist/commands/telemetry.d.ts.map +0 -1
  302. package/dist/commands/telemetry.js +0 -42
  303. package/dist/commands/telemetry.js.map +0 -1
  304. package/dist/commands/test-output.helpers.d.ts +0 -24
  305. package/dist/commands/test-output.helpers.d.ts.map +0 -1
  306. package/dist/commands/test-output.helpers.js +0 -62
  307. package/dist/commands/test-output.helpers.js.map +0 -1
  308. package/dist/commands/test.d.ts +0 -9
  309. package/dist/commands/test.d.ts.map +0 -1
  310. package/dist/commands/test.js +0 -787
  311. package/dist/commands/test.js.map +0 -1
  312. package/dist/commands/update.d.ts +0 -14
  313. package/dist/commands/update.d.ts.map +0 -1
  314. package/dist/commands/update.js +0 -97
  315. package/dist/commands/update.js.map +0 -1
  316. package/dist/commands/webhooks.d.ts +0 -13
  317. package/dist/commands/webhooks.d.ts.map +0 -1
  318. package/dist/commands/webhooks.js +0 -691
  319. package/dist/commands/webhooks.js.map +0 -1
  320. package/dist/compiler/agent-traverser.d.ts +0 -140
  321. package/dist/compiler/agent-traverser.d.ts.map +0 -1
  322. package/dist/compiler/agent-traverser.js +0 -420
  323. package/dist/compiler/agent-traverser.js.map +0 -1
  324. package/dist/compiler/bundler.d.ts +0 -43
  325. package/dist/compiler/bundler.d.ts.map +0 -1
  326. package/dist/compiler/bundler.js +0 -188
  327. package/dist/compiler/bundler.js.map +0 -1
  328. package/dist/compiler/compiler.d.ts +0 -208
  329. package/dist/compiler/compiler.d.ts.map +0 -1
  330. package/dist/compiler/compiler.js +0 -706
  331. package/dist/compiler/compiler.js.map +0 -1
  332. package/dist/compiler/index.d.ts +0 -38
  333. package/dist/compiler/index.d.ts.map +0 -1
  334. package/dist/compiler/index.js +0 -43
  335. package/dist/compiler/index.js.map +0 -1
  336. package/dist/compiler/plugins/agent.plugin.d.ts +0 -58
  337. package/dist/compiler/plugins/agent.plugin.d.ts.map +0 -1
  338. package/dist/compiler/plugins/agent.plugin.js +0 -161
  339. package/dist/compiler/plugins/agent.plugin.js.map +0 -1
  340. package/dist/compiler/plugins/base.d.ts +0 -334
  341. package/dist/compiler/plugins/base.d.ts.map +0 -1
  342. package/dist/compiler/plugins/base.js +0 -353
  343. package/dist/compiler/plugins/base.js.map +0 -1
  344. package/dist/compiler/plugins/device-trigger.plugin.d.ts +0 -38
  345. package/dist/compiler/plugins/device-trigger.plugin.d.ts.map +0 -1
  346. package/dist/compiler/plugins/device-trigger.plugin.js +0 -107
  347. package/dist/compiler/plugins/device-trigger.plugin.js.map +0 -1
  348. package/dist/compiler/plugins/device.plugin.d.ts +0 -39
  349. package/dist/compiler/plugins/device.plugin.d.ts.map +0 -1
  350. package/dist/compiler/plugins/device.plugin.js +0 -77
  351. package/dist/compiler/plugins/device.plugin.js.map +0 -1
  352. package/dist/compiler/plugins/job.plugin.d.ts +0 -34
  353. package/dist/compiler/plugins/job.plugin.d.ts.map +0 -1
  354. package/dist/compiler/plugins/job.plugin.js +0 -108
  355. package/dist/compiler/plugins/job.plugin.js.map +0 -1
  356. package/dist/compiler/plugins/mcp-server.plugin.d.ts +0 -38
  357. package/dist/compiler/plugins/mcp-server.plugin.d.ts.map +0 -1
  358. package/dist/compiler/plugins/mcp-server.plugin.js +0 -107
  359. package/dist/compiler/plugins/mcp-server.plugin.js.map +0 -1
  360. package/dist/compiler/plugins/postprocessor.plugin.d.ts +0 -21
  361. package/dist/compiler/plugins/postprocessor.plugin.d.ts.map +0 -1
  362. package/dist/compiler/plugins/postprocessor.plugin.js +0 -36
  363. package/dist/compiler/plugins/postprocessor.plugin.js.map +0 -1
  364. package/dist/compiler/plugins/preprocessor.plugin.d.ts +0 -21
  365. package/dist/compiler/plugins/preprocessor.plugin.d.ts.map +0 -1
  366. package/dist/compiler/plugins/preprocessor.plugin.js +0 -38
  367. package/dist/compiler/plugins/preprocessor.plugin.js.map +0 -1
  368. package/dist/compiler/plugins/processor-base.d.ts +0 -17
  369. package/dist/compiler/plugins/processor-base.d.ts.map +0 -1
  370. package/dist/compiler/plugins/processor-base.js +0 -27
  371. package/dist/compiler/plugins/processor-base.js.map +0 -1
  372. package/dist/compiler/plugins/registry.d.ts +0 -62
  373. package/dist/compiler/plugins/registry.d.ts.map +0 -1
  374. package/dist/compiler/plugins/registry.js +0 -113
  375. package/dist/compiler/plugins/registry.js.map +0 -1
  376. package/dist/compiler/plugins/skill.plugin.d.ts +0 -106
  377. package/dist/compiler/plugins/skill.plugin.d.ts.map +0 -1
  378. package/dist/compiler/plugins/skill.plugin.js +0 -316
  379. package/dist/compiler/plugins/skill.plugin.js.map +0 -1
  380. package/dist/compiler/plugins/tool.plugin.d.ts +0 -69
  381. package/dist/compiler/plugins/tool.plugin.d.ts.map +0 -1
  382. package/dist/compiler/plugins/tool.plugin.js +0 -262
  383. package/dist/compiler/plugins/tool.plugin.js.map +0 -1
  384. package/dist/compiler/plugins/webhook.plugin.d.ts +0 -38
  385. package/dist/compiler/plugins/webhook.plugin.d.ts.map +0 -1
  386. package/dist/compiler/plugins/webhook.plugin.js +0 -117
  387. package/dist/compiler/plugins/webhook.plugin.js.map +0 -1
  388. package/dist/compiler/source-writer.d.ts +0 -129
  389. package/dist/compiler/source-writer.d.ts.map +0 -1
  390. package/dist/compiler/source-writer.js +0 -329
  391. package/dist/compiler/source-writer.js.map +0 -1
  392. package/dist/compiler/types.d.ts +0 -391
  393. package/dist/compiler/types.d.ts.map +0 -1
  394. package/dist/compiler/types.js +0 -30
  395. package/dist/compiler/types.js.map +0 -1
  396. package/dist/compiler/utils/ast-helpers.d.ts +0 -106
  397. package/dist/compiler/utils/ast-helpers.d.ts.map +0 -1
  398. package/dist/compiler/utils/ast-helpers.js +0 -356
  399. package/dist/compiler/utils/ast-helpers.js.map +0 -1
  400. package/dist/compiler/utils/common.d.ts +0 -22
  401. package/dist/compiler/utils/common.d.ts.map +0 -1
  402. package/dist/compiler/utils/common.js +0 -55
  403. package/dist/compiler/utils/common.js.map +0 -1
  404. package/dist/compiler/utils/file-discovery.d.ts +0 -35
  405. package/dist/compiler/utils/file-discovery.d.ts.map +0 -1
  406. package/dist/compiler/utils/file-discovery.js +0 -60
  407. package/dist/compiler/utils/file-discovery.js.map +0 -1
  408. package/dist/compiler/utils/path-resolver.d.ts +0 -83
  409. package/dist/compiler/utils/path-resolver.d.ts.map +0 -1
  410. package/dist/compiler/utils/path-resolver.js +0 -162
  411. package/dist/compiler/utils/path-resolver.js.map +0 -1
  412. package/dist/compiler/utils/reference-resolver.d.ts +0 -196
  413. package/dist/compiler/utils/reference-resolver.d.ts.map +0 -1
  414. package/dist/compiler/utils/reference-resolver.js +0 -1026
  415. package/dist/compiler/utils/reference-resolver.js.map +0 -1
  416. package/dist/compiler/utils/schema-converter.d.ts +0 -52
  417. package/dist/compiler/utils/schema-converter.d.ts.map +0 -1
  418. package/dist/compiler/utils/schema-converter.js +0 -170
  419. package/dist/compiler/utils/schema-converter.js.map +0 -1
  420. package/dist/compiler/utils/workspace.d.ts +0 -35
  421. package/dist/compiler/utils/workspace.d.ts.map +0 -1
  422. package/dist/compiler/utils/workspace.js +0 -121
  423. package/dist/compiler/utils/workspace.js.map +0 -1
  424. package/dist/config/compile.constants.d.ts +0 -75
  425. package/dist/config/compile.constants.d.ts.map +0 -1
  426. package/dist/config/compile.constants.js +0 -95
  427. package/dist/config/compile.constants.js.map +0 -1
  428. package/dist/config/constants.d.ts +0 -49
  429. package/dist/config/constants.d.ts.map +0 -1
  430. package/dist/config/constants.js +0 -69
  431. package/dist/config/constants.js.map +0 -1
  432. package/dist/errors/auth.error.d.ts +0 -34
  433. package/dist/errors/auth.error.d.ts.map +0 -1
  434. package/dist/errors/auth.error.js +0 -29
  435. package/dist/errors/auth.error.js.map +0 -1
  436. package/dist/errors/index.d.ts +0 -5
  437. package/dist/errors/index.d.ts.map +0 -1
  438. package/dist/errors/index.js +0 -5
  439. package/dist/errors/index.js.map +0 -1
  440. package/dist/index.d.ts.map +0 -1
  441. package/dist/instances/basket.instance.d.ts +0 -82
  442. package/dist/instances/basket.instance.d.ts.map +0 -1
  443. package/dist/instances/basket.instance.js +0 -245
  444. package/dist/instances/basket.instance.js.map +0 -1
  445. package/dist/instances/data.entry.instance.d.ts +0 -50
  446. package/dist/instances/data.entry.instance.d.ts.map +0 -1
  447. package/dist/instances/data.entry.instance.js +0 -163
  448. package/dist/instances/data.entry.instance.js.map +0 -1
  449. package/dist/instances/job.instance.d.ts +0 -133
  450. package/dist/instances/job.instance.d.ts.map +0 -1
  451. package/dist/instances/job.instance.js +0 -180
  452. package/dist/instances/job.instance.js.map +0 -1
  453. package/dist/instances/order.instance.d.ts +0 -50
  454. package/dist/instances/order.instance.d.ts.map +0 -1
  455. package/dist/instances/order.instance.js +0 -199
  456. package/dist/instances/order.instance.js.map +0 -1
  457. package/dist/instances/product.instance.d.ts +0 -43
  458. package/dist/instances/product.instance.d.ts.map +0 -1
  459. package/dist/instances/product.instance.js +0 -145
  460. package/dist/instances/product.instance.js.map +0 -1
  461. package/dist/instances/product.pagination.instance.d.ts +0 -102
  462. package/dist/instances/product.pagination.instance.d.ts.map +0 -1
  463. package/dist/instances/product.pagination.instance.js +0 -156
  464. package/dist/instances/product.pagination.instance.js.map +0 -1
  465. package/dist/instances/product.search.instance.d.ts +0 -81
  466. package/dist/instances/product.search.instance.d.ts.map +0 -1
  467. package/dist/instances/product.search.instance.js +0 -121
  468. package/dist/instances/product.search.instance.js.map +0 -1
  469. package/dist/instances/user.instance.d.ts +0 -56
  470. package/dist/instances/user.instance.d.ts.map +0 -1
  471. package/dist/instances/user.instance.js +0 -188
  472. package/dist/instances/user.instance.js.map +0 -1
  473. package/dist/interfaces/admin.d.ts +0 -64
  474. package/dist/interfaces/admin.d.ts.map +0 -1
  475. package/dist/interfaces/admin.js +0 -6
  476. package/dist/interfaces/admin.js.map +0 -1
  477. package/dist/interfaces/agent.d.ts +0 -399
  478. package/dist/interfaces/agent.d.ts.map +0 -1
  479. package/dist/interfaces/agent.js +0 -6
  480. package/dist/interfaces/agent.js.map +0 -1
  481. package/dist/interfaces/backup.d.ts +0 -17
  482. package/dist/interfaces/backup.d.ts.map +0 -1
  483. package/dist/interfaces/backup.js +0 -7
  484. package/dist/interfaces/backup.js.map +0 -1
  485. package/dist/interfaces/baskets.d.ts +0 -80
  486. package/dist/interfaces/baskets.d.ts.map +0 -1
  487. package/dist/interfaces/baskets.js +0 -20
  488. package/dist/interfaces/baskets.js.map +0 -1
  489. package/dist/interfaces/cdn.d.ts +0 -25
  490. package/dist/interfaces/cdn.d.ts.map +0 -1
  491. package/dist/interfaces/cdn.js +0 -6
  492. package/dist/interfaces/cdn.js.map +0 -1
  493. package/dist/interfaces/chat.d.ts +0 -98
  494. package/dist/interfaces/chat.d.ts.map +0 -1
  495. package/dist/interfaces/chat.js +0 -6
  496. package/dist/interfaces/chat.js.map +0 -1
  497. package/dist/interfaces/common.d.ts +0 -64
  498. package/dist/interfaces/common.d.ts.map +0 -1
  499. package/dist/interfaces/common.js +0 -9
  500. package/dist/interfaces/common.js.map +0 -1
  501. package/dist/interfaces/custom.data.d.ts +0 -83
  502. package/dist/interfaces/custom.data.d.ts.map +0 -1
  503. package/dist/interfaces/custom.data.js +0 -6
  504. package/dist/interfaces/custom.data.js.map +0 -1
  505. package/dist/interfaces/deploy.d.ts +0 -15
  506. package/dist/interfaces/deploy.d.ts.map +0 -1
  507. package/dist/interfaces/deploy.js +0 -5
  508. package/dist/interfaces/deploy.js.map +0 -1
  509. package/dist/interfaces/dev.d.ts +0 -54
  510. package/dist/interfaces/dev.d.ts.map +0 -1
  511. package/dist/interfaces/dev.js +0 -6
  512. package/dist/interfaces/dev.js.map +0 -1
  513. package/dist/interfaces/device-triggers.d.ts +0 -80
  514. package/dist/interfaces/device-triggers.d.ts.map +0 -1
  515. package/dist/interfaces/device-triggers.js +0 -6
  516. package/dist/interfaces/device-triggers.js.map +0 -1
  517. package/dist/interfaces/devices.d.ts +0 -74
  518. package/dist/interfaces/devices.d.ts.map +0 -1
  519. package/dist/interfaces/devices.js +0 -5
  520. package/dist/interfaces/devices.js.map +0 -1
  521. package/dist/interfaces/index.d.ts +0 -15
  522. package/dist/interfaces/index.d.ts.map +0 -1
  523. package/dist/interfaces/index.js +0 -8
  524. package/dist/interfaces/index.js.map +0 -1
  525. package/dist/interfaces/init.d.ts +0 -42
  526. package/dist/interfaces/init.d.ts.map +0 -1
  527. package/dist/interfaces/init.js +0 -5
  528. package/dist/interfaces/init.js.map +0 -1
  529. package/dist/interfaces/jobs.d.ts +0 -149
  530. package/dist/interfaces/jobs.d.ts.map +0 -1
  531. package/dist/interfaces/jobs.js +0 -6
  532. package/dist/interfaces/jobs.js.map +0 -1
  533. package/dist/interfaces/logs.d.ts +0 -44
  534. package/dist/interfaces/logs.d.ts.map +0 -1
  535. package/dist/interfaces/logs.js +0 -6
  536. package/dist/interfaces/logs.js.map +0 -1
  537. package/dist/interfaces/lua.d.ts +0 -37
  538. package/dist/interfaces/lua.d.ts.map +0 -1
  539. package/dist/interfaces/lua.js +0 -6
  540. package/dist/interfaces/lua.js.map +0 -1
  541. package/dist/interfaces/marketplace.d.ts +0 -171
  542. package/dist/interfaces/marketplace.d.ts.map +0 -1
  543. package/dist/interfaces/marketplace.js +0 -3
  544. package/dist/interfaces/marketplace.js.map +0 -1
  545. package/dist/interfaces/mcp.d.ts +0 -96
  546. package/dist/interfaces/mcp.d.ts.map +0 -1
  547. package/dist/interfaces/mcp.js +0 -9
  548. package/dist/interfaces/mcp.js.map +0 -1
  549. package/dist/interfaces/message.d.ts +0 -16
  550. package/dist/interfaces/message.d.ts.map +0 -1
  551. package/dist/interfaces/message.js +0 -2
  552. package/dist/interfaces/message.js.map +0 -1
  553. package/dist/interfaces/orders.d.ts +0 -68
  554. package/dist/interfaces/orders.d.ts.map +0 -1
  555. package/dist/interfaces/orders.js +0 -20
  556. package/dist/interfaces/orders.js.map +0 -1
  557. package/dist/interfaces/persona.d.ts +0 -44
  558. package/dist/interfaces/persona.d.ts.map +0 -1
  559. package/dist/interfaces/persona.js +0 -6
  560. package/dist/interfaces/persona.js.map +0 -1
  561. package/dist/interfaces/postprocessors.d.ts +0 -15
  562. package/dist/interfaces/postprocessors.d.ts.map +0 -1
  563. package/dist/interfaces/postprocessors.js +0 -5
  564. package/dist/interfaces/postprocessors.js.map +0 -1
  565. package/dist/interfaces/preprocessors.d.ts +0 -15
  566. package/dist/interfaces/preprocessors.d.ts.map +0 -1
  567. package/dist/interfaces/preprocessors.js +0 -5
  568. package/dist/interfaces/preprocessors.js.map +0 -1
  569. package/dist/interfaces/product.d.ts +0 -92
  570. package/dist/interfaces/product.d.ts.map +0 -1
  571. package/dist/interfaces/product.js +0 -6
  572. package/dist/interfaces/product.js.map +0 -1
  573. package/dist/interfaces/push.d.ts +0 -27
  574. package/dist/interfaces/push.d.ts.map +0 -1
  575. package/dist/interfaces/push.js +0 -5
  576. package/dist/interfaces/push.js.map +0 -1
  577. package/dist/interfaces/skills.d.ts +0 -137
  578. package/dist/interfaces/skills.d.ts.map +0 -1
  579. package/dist/interfaces/skills.js +0 -6
  580. package/dist/interfaces/skills.js.map +0 -1
  581. package/dist/interfaces/test.d.ts +0 -37
  582. package/dist/interfaces/test.d.ts.map +0 -1
  583. package/dist/interfaces/test.js +0 -5
  584. package/dist/interfaces/test.js.map +0 -1
  585. package/dist/interfaces/unifiedto.d.ts +0 -141
  586. package/dist/interfaces/unifiedto.d.ts.map +0 -1
  587. package/dist/interfaces/unifiedto.js +0 -6
  588. package/dist/interfaces/unifiedto.js.map +0 -1
  589. package/dist/interfaces/user.d.ts +0 -75
  590. package/dist/interfaces/user.d.ts.map +0 -1
  591. package/dist/interfaces/user.js +0 -2
  592. package/dist/interfaces/user.js.map +0 -1
  593. package/dist/interfaces/webhooks.d.ts +0 -97
  594. package/dist/interfaces/webhooks.d.ts.map +0 -1
  595. package/dist/interfaces/webhooks.js +0 -6
  596. package/dist/interfaces/webhooks.js.map +0 -1
  597. package/dist/interfaces/whatsapp-templates.d.ts +0 -105
  598. package/dist/interfaces/whatsapp-templates.d.ts.map +0 -1
  599. package/dist/interfaces/whatsapp-templates.js +0 -6
  600. package/dist/interfaces/whatsapp-templates.js.map +0 -1
  601. package/dist/primitives/agent.handler.d.ts +0 -71
  602. package/dist/primitives/agent.handler.d.ts.map +0 -1
  603. package/dist/primitives/agent.handler.js +0 -226
  604. package/dist/primitives/agent.handler.js.map +0 -1
  605. package/dist/primitives/base.handler.d.ts +0 -229
  606. package/dist/primitives/base.handler.d.ts.map +0 -1
  607. package/dist/primitives/base.handler.js +0 -620
  608. package/dist/primitives/base.handler.js.map +0 -1
  609. package/dist/primitives/device-trigger.handler.d.ts +0 -56
  610. package/dist/primitives/device-trigger.handler.d.ts.map +0 -1
  611. package/dist/primitives/device-trigger.handler.js +0 -99
  612. package/dist/primitives/device-trigger.handler.js.map +0 -1
  613. package/dist/primitives/device.handler.d.ts +0 -57
  614. package/dist/primitives/device.handler.d.ts.map +0 -1
  615. package/dist/primitives/device.handler.js +0 -103
  616. package/dist/primitives/device.handler.js.map +0 -1
  617. package/dist/primitives/index.d.ts +0 -51
  618. package/dist/primitives/index.d.ts.map +0 -1
  619. package/dist/primitives/index.js +0 -75
  620. package/dist/primitives/index.js.map +0 -1
  621. package/dist/primitives/job.handler.d.ts +0 -53
  622. package/dist/primitives/job.handler.d.ts.map +0 -1
  623. package/dist/primitives/job.handler.js +0 -110
  624. package/dist/primitives/job.handler.js.map +0 -1
  625. package/dist/primitives/mcp-server.handler.d.ts +0 -93
  626. package/dist/primitives/mcp-server.handler.d.ts.map +0 -1
  627. package/dist/primitives/mcp-server.handler.js +0 -216
  628. package/dist/primitives/mcp-server.handler.js.map +0 -1
  629. package/dist/primitives/postprocessor.handler.d.ts +0 -44
  630. package/dist/primitives/postprocessor.handler.d.ts.map +0 -1
  631. package/dist/primitives/postprocessor.handler.js +0 -71
  632. package/dist/primitives/postprocessor.handler.js.map +0 -1
  633. package/dist/primitives/preprocessor.handler.d.ts +0 -44
  634. package/dist/primitives/preprocessor.handler.d.ts.map +0 -1
  635. package/dist/primitives/preprocessor.handler.js +0 -72
  636. package/dist/primitives/preprocessor.handler.js.map +0 -1
  637. package/dist/primitives/skill.handler.d.ts +0 -47
  638. package/dist/primitives/skill.handler.d.ts.map +0 -1
  639. package/dist/primitives/skill.handler.js +0 -229
  640. package/dist/primitives/skill.handler.js.map +0 -1
  641. package/dist/primitives/types.d.ts +0 -91
  642. package/dist/primitives/types.d.ts.map +0 -1
  643. package/dist/primitives/types.js +0 -17
  644. package/dist/primitives/types.js.map +0 -1
  645. package/dist/primitives/webhook.handler.d.ts +0 -47
  646. package/dist/primitives/webhook.handler.d.ts.map +0 -1
  647. package/dist/primitives/webhook.handler.js +0 -87
  648. package/dist/primitives/webhook.handler.js.map +0 -1
  649. package/dist/services/analytics.d.ts +0 -57
  650. package/dist/services/analytics.d.ts.map +0 -1
  651. package/dist/services/analytics.js +0 -317
  652. package/dist/services/analytics.js.map +0 -1
  653. package/dist/services/auth.d.ts +0 -72
  654. package/dist/services/auth.d.ts.map +0 -1
  655. package/dist/services/auth.js +0 -173
  656. package/dist/services/auth.js.map +0 -1
  657. package/dist/services/sandbox.service.d.ts +0 -105
  658. package/dist/services/sandbox.service.d.ts.map +0 -1
  659. package/dist/services/sandbox.service.js +0 -531
  660. package/dist/services/sandbox.service.js.map +0 -1
  661. package/dist/types/api-contracts.d.ts +0 -287
  662. package/dist/types/api-contracts.d.ts.map +0 -1
  663. package/dist/types/api-contracts.js +0 -2
  664. package/dist/types/api-contracts.js.map +0 -1
  665. package/dist/types/index.d.ts +0 -28
  666. package/dist/types/index.d.ts.map +0 -1
  667. package/dist/types/index.js +0 -30
  668. package/dist/types/index.js.map +0 -1
  669. package/dist/types/skill.d.ts +0 -1079
  670. package/dist/types/skill.d.ts.map +0 -1
  671. package/dist/types/skill.js +0 -688
  672. package/dist/types/skill.js.map +0 -1
  673. package/dist/types/tool-validation.d.ts +0 -35
  674. package/dist/types/tool-validation.d.ts.map +0 -1
  675. package/dist/types/tool-validation.js +0 -43
  676. package/dist/types/tool-validation.js.map +0 -1
  677. package/dist/types/yaml.types.d.ts +0 -91
  678. package/dist/types/yaml.types.d.ts.map +0 -1
  679. package/dist/types/yaml.types.js +0 -5
  680. package/dist/types/yaml.types.js.map +0 -1
  681. package/dist/utils/aliases.d.ts +0 -7
  682. package/dist/utils/aliases.d.ts.map +0 -1
  683. package/dist/utils/aliases.js +0 -492
  684. package/dist/utils/aliases.js.map +0 -1
  685. package/dist/utils/artifact-loader.d.ts +0 -152
  686. package/dist/utils/artifact-loader.d.ts.map +0 -1
  687. package/dist/utils/artifact-loader.js +0 -284
  688. package/dist/utils/artifact-loader.js.map +0 -1
  689. package/dist/utils/auth-flows.d.ts +0 -55
  690. package/dist/utils/auth-flows.d.ts.map +0 -1
  691. package/dist/utils/auth-flows.js +0 -246
  692. package/dist/utils/auth-flows.js.map +0 -1
  693. package/dist/utils/backup-helpers.d.ts +0 -238
  694. package/dist/utils/backup-helpers.d.ts.map +0 -1
  695. package/dist/utils/backup-helpers.js +0 -704
  696. package/dist/utils/backup-helpers.js.map +0 -1
  697. package/dist/utils/build-manifest-from-disk.d.ts +0 -8
  698. package/dist/utils/build-manifest-from-disk.d.ts.map +0 -1
  699. package/dist/utils/build-manifest-from-disk.js +0 -21
  700. package/dist/utils/build-manifest-from-disk.js.map +0 -1
  701. package/dist/utils/bundle-upload.d.ts +0 -42
  702. package/dist/utils/bundle-upload.d.ts.map +0 -1
  703. package/dist/utils/bundle-upload.js +0 -90
  704. package/dist/utils/bundle-upload.js.map +0 -1
  705. package/dist/utils/chat-attachments.d.ts +0 -15
  706. package/dist/utils/chat-attachments.d.ts.map +0 -1
  707. package/dist/utils/chat-attachments.js +0 -116
  708. package/dist/utils/chat-attachments.js.map +0 -1
  709. package/dist/utils/cli.d.ts +0 -62
  710. package/dist/utils/cli.d.ts.map +0 -1
  711. package/dist/utils/cli.js +0 -198
  712. package/dist/utils/cli.js.map +0 -1
  713. package/dist/utils/command-utils.d.ts +0 -46
  714. package/dist/utils/command-utils.d.ts.map +0 -1
  715. package/dist/utils/command-utils.js +0 -74
  716. package/dist/utils/command-utils.js.map +0 -1
  717. package/dist/utils/deploy-helpers.d.ts +0 -40
  718. package/dist/utils/deploy-helpers.d.ts.map +0 -1
  719. package/dist/utils/deploy-helpers.js +0 -76
  720. package/dist/utils/deploy-helpers.js.map +0 -1
  721. package/dist/utils/env-loader.utils.d.ts +0 -19
  722. package/dist/utils/env-loader.utils.d.ts.map +0 -1
  723. package/dist/utils/env-loader.utils.js +0 -90
  724. package/dist/utils/env-loader.utils.js.map +0 -1
  725. package/dist/utils/files.d.ts +0 -65
  726. package/dist/utils/files.d.ts.map +0 -1
  727. package/dist/utils/files.js +0 -193
  728. package/dist/utils/files.js.map +0 -1
  729. package/dist/utils/hints.d.ts +0 -81
  730. package/dist/utils/hints.d.ts.map +0 -1
  731. package/dist/utils/hints.js +0 -81
  732. package/dist/utils/hints.js.map +0 -1
  733. package/dist/utils/init-agent.d.ts +0 -86
  734. package/dist/utils/init-agent.d.ts.map +0 -1
  735. package/dist/utils/init-agent.js +0 -201
  736. package/dist/utils/init-agent.js.map +0 -1
  737. package/dist/utils/init-helpers.d.ts +0 -37
  738. package/dist/utils/init-helpers.d.ts.map +0 -1
  739. package/dist/utils/init-helpers.js +0 -78
  740. package/dist/utils/init-helpers.js.map +0 -1
  741. package/dist/utils/init-prompts.d.ts +0 -74
  742. package/dist/utils/init-prompts.d.ts.map +0 -1
  743. package/dist/utils/init-prompts.js +0 -256
  744. package/dist/utils/init-prompts.js.map +0 -1
  745. package/dist/utils/prompt-handler.d.ts +0 -17
  746. package/dist/utils/prompt-handler.d.ts.map +0 -1
  747. package/dist/utils/prompt-handler.js +0 -49
  748. package/dist/utils/prompt-handler.js.map +0 -1
  749. package/dist/utils/sandbox-storage.d.ts +0 -83
  750. package/dist/utils/sandbox-storage.d.ts.map +0 -1
  751. package/dist/utils/sandbox-storage.js +0 -211
  752. package/dist/utils/sandbox-storage.js.map +0 -1
  753. package/dist/utils/sandbox.d.ts +0 -76
  754. package/dist/utils/sandbox.d.ts.map +0 -1
  755. package/dist/utils/sandbox.js +0 -664
  756. package/dist/utils/sandbox.js.map +0 -1
  757. package/dist/utils/semver.d.ts +0 -40
  758. package/dist/utils/semver.d.ts.map +0 -1
  759. package/dist/utils/semver.js +0 -99
  760. package/dist/utils/semver.js.map +0 -1
  761. package/dist/utils/suggest.d.ts +0 -3
  762. package/dist/utils/suggest.d.ts.map +0 -1
  763. package/dist/utils/suggest.js +0 -32
  764. package/dist/utils/suggest.js.map +0 -1
  765. package/dist/utils/sync-display.d.ts +0 -28
  766. package/dist/utils/sync-display.d.ts.map +0 -1
  767. package/dist/utils/sync-display.js +0 -168
  768. package/dist/utils/sync-display.js.map +0 -1
  769. package/dist/utils/sync-fetch.d.ts +0 -108
  770. package/dist/utils/sync-fetch.d.ts.map +0 -1
  771. package/dist/utils/sync-fetch.js +0 -294
  772. package/dist/utils/sync-fetch.js.map +0 -1
  773. package/dist/utils/sync-helpers.d.ts +0 -7
  774. package/dist/utils/sync-helpers.d.ts.map +0 -1
  775. package/dist/utils/sync-helpers.js +0 -7
  776. package/dist/utils/sync-helpers.js.map +0 -1
  777. package/dist/utils/version-check.d.ts +0 -37
  778. package/dist/utils/version-check.d.ts.map +0 -1
  779. package/dist/utils/version-check.js +0 -117
  780. package/dist/utils/version-check.js.map +0 -1
  781. package/dist/utils/write-info.d.ts +0 -9
  782. package/dist/utils/write-info.d.ts.map +0 -1
  783. package/dist/utils/write-info.js +0 -11
  784. package/dist/utils/write-info.js.map +0 -1
  785. package/node_modules/@lua/shared-source-sync/dist/index.d.mts +0 -424
  786. package/node_modules/@lua/shared-source-sync/dist/index.d.ts +0 -424
  787. package/node_modules/@lua/shared-source-sync/dist/index.js +0 -536
  788. package/node_modules/@lua/shared-source-sync/dist/index.mjs +0 -491
  789. package/node_modules/@lua/shared-source-sync/package.json +0 -26
  790. package/node_modules/@lua/shared-source-sync/src/archive.ts +0 -98
  791. package/node_modules/@lua/shared-source-sync/src/filter.ts +0 -72
  792. package/node_modules/@lua/shared-source-sync/src/hash.ts +0 -40
  793. package/node_modules/@lua/shared-source-sync/src/http.ts +0 -132
  794. package/node_modules/@lua/shared-source-sync/src/index.ts +0 -56
  795. package/node_modules/@lua/shared-source-sync/src/pull.ts +0 -50
  796. package/node_modules/@lua/shared-source-sync/src/push.ts +0 -94
  797. package/node_modules/@lua/shared-source-sync/src/restore.ts +0 -83
  798. package/node_modules/@lua/shared-source-sync/src/skill-source.ts +0 -55
  799. package/node_modules/@lua/shared-source-sync/src/transfer.ts +0 -92
  800. package/node_modules/@lua/shared-source-sync/src/types.ts +0 -88
  801. package/node_modules/@lua/shared-source-sync/src/walk.ts +0 -91
  802. package/node_modules/@lua/shared-source-sync/tests/archive.test.ts +0 -108
  803. package/node_modules/@lua/shared-source-sync/tests/hash.test.ts +0 -40
  804. package/node_modules/@lua/shared-source-sync/tests/http.test.ts +0 -77
  805. package/node_modules/@lua/shared-source-sync/tests/push.test.ts +0 -162
  806. package/node_modules/@lua/shared-source-sync/tests/walk.test.ts +0 -84
  807. package/node_modules/@lua/shared-source-sync/tsconfig.json +0 -12
  808. package/node_modules/@lua/shared-source-sync/tsup.config.ts +0 -9
  809. package/node_modules/@lua/shared-source-sync/vitest.config.ts +0 -8
  810. package/node_modules/@lua/shared-types/dist/index.d.mts +0 -619
  811. package/node_modules/@lua/shared-types/dist/index.d.ts +0 -619
  812. package/node_modules/@lua/shared-types/dist/index.js +0 -435
  813. package/node_modules/@lua/shared-types/dist/index.mjs +0 -394
  814. package/node_modules/@lua/shared-types/package.json +0 -26
  815. package/node_modules/@lua/shared-types/src/agent-config.types.ts +0 -45
  816. package/node_modules/@lua/shared-types/src/agent-invocation.types.ts +0 -73
  817. package/node_modules/@lua/shared-types/src/ai-generate.types.ts +0 -74
  818. package/node_modules/@lua/shared-types/src/ai-generate.utils.ts +0 -16
  819. package/node_modules/@lua/shared-types/src/channel.type.ts +0 -23
  820. package/node_modules/@lua/shared-types/src/chat-history.types.ts +0 -112
  821. package/node_modules/@lua/shared-types/src/chat-stream.types.ts +0 -18
  822. package/node_modules/@lua/shared-types/src/client-tools.types.ts +0 -47
  823. package/node_modules/@lua/shared-types/src/device.types.ts +0 -190
  824. package/node_modules/@lua/shared-types/src/index.ts +0 -15
  825. package/node_modules/@lua/shared-types/src/model-registry.ts +0 -26
  826. package/node_modules/@lua/shared-types/src/persona-defaults.ts +0 -59
  827. package/node_modules/@lua/shared-types/src/persona-text.type.ts +0 -92
  828. package/node_modules/@lua/shared-types/src/sandbox-contract.ts +0 -63
  829. package/node_modules/@lua/shared-types/src/unstructured-types.ts +0 -58
  830. package/node_modules/@lua/shared-types/src/vm-execution-log.types.ts +0 -41
  831. package/node_modules/@lua/shared-types/tsconfig.json +0 -12
  832. package/node_modules/@lua/shared-types/tsup.config.ts +0 -9
  833. package/scripts/resolve-workspace-deps.cjs +0 -61
  834. /package/dist/{compiler/utils/zod-runtime.mjs → zod-runtime.mjs} +0 -0
@@ -1,1262 +0,0 @@
1
- /**
2
- * Push Command
3
- * Orchestrates pushing skill versions to the server
4
- */
5
- import { hasPersonaTextContent, flattenPersonaTextAll } from '@lua/shared-types';
6
- import { compileCommand } from './compile.js';
7
- import { readYamlConfig } from '../utils/files.js';
8
- import { withErrorHandling, writeProgress, writeSuccess, writeInfo, writeError, clearPromptLines, writeNextStep, writeHintBlock, writeTip, } from '../utils/cli.js';
9
- import { requireAuthOrExit } from '../utils/command-utils.js';
10
- import { safePrompt } from '../utils/prompt-handler.js';
11
- import { incrementPatchVersion, maxSemver } from '../utils/semver.js';
12
- import { AuthenticationError } from '../errors/auth.error.js';
13
- import { BASE_URLS } from '../config/constants.js';
14
- import PersonaApi from '../api/persona.api.service.js';
15
- import { loadManifest, getPrimitivesByKind } from '../utils/artifact-loader.js';
16
- import { ensureBundlesUploaded } from '../utils/bundle-upload.js';
17
- import { PrimitiveKind } from '../compiler/types.js';
18
- import { agentHandler } from '../primitives/agent.handler.js';
19
- import { skillHandler as skillH, webhookHandler as webhookH, jobHandler as jobH, preprocessorHandler as preprocessorH, postprocessorHandler as postprocessorH, deviceHandler as deviceH, deviceTriggerHandler as deviceTriggerH, } from '../primitives/index.js';
20
- import { pushBackupCommand, runBackupPush } from './pushBackup.js';
21
- import { buildLogsCommand } from './log-tip.js';
22
- import { trackEvent } from '../services/analytics.js';
23
- import { validateOrSuggest } from '../utils/aliases.js';
24
- import { ARCHIVE_SCHEMA_VERSION, encodeWorkspaceArchive } from '@lua/shared-source-sync';
25
- import SkillApi from '../api/skills.api.service.js';
26
- export { pickPushAllNextStepVariant, formatPushFailureSummary } from './push-helpers.js';
27
- import { pickPushAllNextStepVariant, formatPushFailureSummary } from './push-helpers.js';
28
- /**
29
- * Maps push target type to a valid `lua deploy …` follow-up (or null when
30
- * there is no deploy CLI surface for that type — e.g. mcp, device, backup).
31
- */
32
- function getDeployHint(type) {
33
- const deployableMap = {
34
- skill: 'lua deploy skill',
35
- webhook: 'lua deploy webhook',
36
- job: 'lua deploy job',
37
- preprocessor: 'lua deploy preprocessor',
38
- postprocessor: 'lua deploy postprocessor',
39
- agent: 'lua deploy persona',
40
- persona: 'lua deploy persona',
41
- };
42
- const cmd = deployableMap[type];
43
- if (!cmd)
44
- return null;
45
- return { label: 'Deploy:', command: cmd };
46
- }
47
- // ============================================================================
48
- // Core Push Helpers (shared by all push functions)
49
- // ============================================================================
50
- /**
51
- * Prompts user to confirm or update the version.
52
- *
53
- * @param currentVersion - Current version of the skill
54
- * @returns Confirmed or updated version
55
- */
56
- async function promptVersionConfirmOrUpdate(currentVersion) {
57
- console.log(`\nCurrent version: ${currentVersion || '(none - first push)'}`);
58
- const answer = await safePrompt([
59
- {
60
- type: 'input',
61
- name: 'newVersion',
62
- message: 'Enter new version to push:',
63
- default: incrementPatchVersion(currentVersion),
64
- validate: (input) => {
65
- if (!input || input.trim() === '') {
66
- return 'Version cannot be empty';
67
- }
68
- // Basic semver validation
69
- const semverRegex = /^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?$/;
70
- if (!semverRegex.test(input.trim())) {
71
- return 'Version must follow semver format (e.g., 1.0.0, 1.0.0-alpha.1)';
72
- }
73
- return true;
74
- },
75
- },
76
- ]);
77
- if (!answer) {
78
- console.log('Push cancelled.');
79
- process.exit(0);
80
- }
81
- clearPromptLines(2);
82
- return answer.newVersion.trim();
83
- }
84
- /**
85
- * Authenticates the user and returns the API key
86
- * Exits with error if authentication fails
87
- */
88
- async function authenticateOrFail() {
89
- return requireAuthOrExit(false);
90
- }
91
- /**
92
- * Selects an entity from a list, either by options.entityName or interactive prompt
93
- * @param items - Array of items to select from
94
- * @param options - Push options with entityName
95
- * @param config - Configuration for selection behavior
96
- */
97
- async function selectEntityOrFail(items, options, config) {
98
- const { entityType, nameFields = ['id', 'name'], formatChoice } = config;
99
- if (items.length === 0) {
100
- throw new Error(`No ${entityType}s found in lua.skill.yaml.`);
101
- }
102
- // Non-interactive: find by name
103
- if (options.entityName) {
104
- const found = items.find((item) => nameFields.some((field) => item[field] === options.entityName));
105
- if (!found) {
106
- throw new Error(`${entityType} "${options.entityName}" not found`);
107
- }
108
- writeInfo(`šŸ“¦ Selected ${entityType}: ${found.name}`);
109
- return found;
110
- }
111
- // Single item: use it automatically
112
- if (items.length === 1) {
113
- writeInfo(`šŸ“¦ Pushing ${entityType}: ${items[0].name}`);
114
- return items[0];
115
- }
116
- // Multiple items: prompt for selection
117
- const answer = await safePrompt([
118
- {
119
- type: 'list',
120
- name: 'selected',
121
- message: `Select a ${entityType} to push:`,
122
- choices: items.map((item) => ({
123
- name: formatChoice ? formatChoice(item) : `${item.name} (v${item.version})`,
124
- value: item,
125
- })),
126
- },
127
- ]);
128
- if (!answer) {
129
- console.log('Push cancelled.');
130
- process.exit(0);
131
- }
132
- writeInfo(`šŸ“¦ Selected ${entityType}: ${answer.selected.name}`);
133
- return answer.selected;
134
- }
135
- /**
136
- * Resolves version from options or interactive prompt
137
- * Validates semantic versioning format
138
- */
139
- async function resolveVersionOrFail(currentVersion, options, highestKnownVersion) {
140
- // If version explicitly provided, use it
141
- if (options.version) {
142
- if (!/^\d+\.\d+\.\d+/.test(options.version)) {
143
- throw new Error(`Invalid version format: "${options.version}". Use semantic versioning (e.g., 1.0.5)`);
144
- }
145
- writeInfo(`šŸ“ Using version: ${options.version}`);
146
- return options.version;
147
- }
148
- // If force flag provided, auto-bump without prompting
149
- if (options.force) {
150
- // Bump from the highest known version (max of YAML and server) to avoid conflicts
151
- const baseVersion = highestKnownVersion ? maxSemver(currentVersion, highestKnownVersion) : currentVersion;
152
- const newVersion = incrementPatchVersion(baseVersion);
153
- writeInfo(`šŸ“ Auto-bumping version: ${currentVersion} → ${newVersion}`);
154
- return newVersion;
155
- }
156
- // Otherwise, prompt interactively
157
- return await promptVersionConfirmOrUpdate(currentVersion);
158
- }
159
- /**
160
- * Determines if we should deploy after push based on options or prompt
161
- */
162
- async function shouldDeployAfterPush(options) {
163
- // Auto-deploy flag takes precedence
164
- if (options.autoDeploy) {
165
- return true;
166
- }
167
- // Force mode skips the prompt (no deploy)
168
- if (options.force) {
169
- return false;
170
- }
171
- // Interactive: ask user
172
- const answer = await safePrompt([
173
- {
174
- type: 'confirm',
175
- name: 'deployNow',
176
- message: 'Would you like to deploy this version to production now?',
177
- default: false,
178
- },
179
- ]);
180
- return answer?.deployNow || false;
181
- }
182
- // ============================================================================
183
- // Generic Push/Deploy (replaces per-type push/deploy functions)
184
- // ============================================================================
185
- /**
186
- * Generic push for any versioned primitive (webhook, job, preprocessor, postprocessor).
187
- * Skill has its own flow due to tools array + config validation.
188
- */
189
- async function pushVersionedPrimitive(handler, options = {}) {
190
- try {
191
- // Step 1: Compile
192
- writeProgress('šŸ“¦ Compiling project...');
193
- await compileCommand();
194
- writeSuccess('āœ… Compilation complete');
195
- // Step 2: Authenticate
196
- const apiKey = await authenticateOrFail();
197
- writeSuccess('āœ… Authentication verified');
198
- // Step 3: Read config
199
- const config = readYamlConfig();
200
- if (!config?.agent?.agentId) {
201
- throw new Error("No agent ID found in lua.skill.yaml. Please run 'lua init' first.");
202
- }
203
- const agentId = config.agent.agentId;
204
- // Step 4: Get items from YAML and select
205
- const items = handler.getFromYaml(config);
206
- if (items.length === 0) {
207
- throw new Error(`No ${handler.displayNamePlural} found in lua.skill.yaml.`);
208
- }
209
- const selected = await selectEntityOrFail(items, options, {
210
- entityType: handler.displayName,
211
- nameFields: ['id', handler.yamlConfig.idField, 'name'],
212
- });
213
- const entityId = selected[handler.yamlConfig.idField];
214
- if (!entityId) {
215
- throw new Error(`${handler.displayName} "${selected.name}" has no server ID. Run 'lua compile' first.`);
216
- }
217
- // Step 5: Load bundled data — accumulate raw gzip blobs for presigned upload (BAC-196)
218
- const manifest = loadManifest();
219
- const bundleAccumulator = new Map();
220
- const pushData = handler.prepareForPush(manifest, selected.name, undefined, bundleAccumulator);
221
- if (!pushData) {
222
- throw new Error(`${handler.displayName} "${selected.name}" not found in compiled output.`);
223
- }
224
- // Step 5b: Upload missing blobs to S3 via presigned PUT, skip ones already there.
225
- let bundleStats = {
226
- total: 0,
227
- alreadyExisted: 0,
228
- uploaded: 0,
229
- };
230
- if (bundleAccumulator.size > 0) {
231
- writeProgress(`šŸ“¤ Uploading ${bundleAccumulator.size} bundle(s) to S3...`);
232
- bundleStats = await ensureBundlesUploaded(apiKey, agentId, bundleAccumulator);
233
- writeSuccess('āœ… Bundles uploaded');
234
- }
235
- // Step 6: Resolve version (check server for highest to avoid conflicts)
236
- const serverHighest = options.force ? await handler.getHighestServerVersion(apiKey, agentId, entityId) : undefined;
237
- const confirmedVersion = await resolveVersionOrFail(selected.version, options, serverHighest ?? undefined);
238
- if (confirmedVersion !== selected.version) {
239
- handler.updateVersionInYaml(selected.name, confirmedVersion);
240
- }
241
- // Step 7: Push
242
- writeProgress(`\nšŸš€ Pushing ${selected.name} v${confirmedVersion} to server...`);
243
- const result = await handler.pushToServer(apiKey, agentId, entityId, { ...pushData, version: confirmedVersion });
244
- if (!result.success) {
245
- const isVersionConflict = result.error?.toLowerCase().includes('already exists');
246
- if (isVersionConflict) {
247
- writeHintBlock({
248
- headline: 'Version conflict — this version already exists on the server.',
249
- lines: [
250
- { label: 'Auto-bump:', command: `lua push ${handler.kind} --force` },
251
- { label: 'Or push all:', command: 'lua push all --force' },
252
- ],
253
- when: 'error',
254
- });
255
- }
256
- // Push rejected — the reason is already on screen in the error above.
257
- // No lua logs hint here: the push never ran, so no execution logs exist.
258
- throw new Error(`Push Error: ${result.error || 'Unknown error'}`);
259
- }
260
- writeSuccess(`\nāœ… Successfully pushed ${selected.name} v${confirmedVersion}\n`);
261
- // Step 8: Deploy if requested
262
- if (await shouldDeployAfterPush(options)) {
263
- const deployedOk = await genericDeployAfterPush(handler, apiKey, agentId, entityId, selected.name, confirmedVersion, options.autoDeploy || false);
264
- return { productionDeploySucceeded: deployedOk, bundleStats };
265
- }
266
- return { productionDeploySucceeded: false, bundleStats };
267
- // Staging vs deployed hints run in pushCommand — avoid duplicates here (H8).
268
- }
269
- catch (error) {
270
- throw error;
271
- }
272
- }
273
- /**
274
- * Generic deploy/publish after push for any versioned primitive.
275
- */
276
- async function genericDeployAfterPush(handler, apiKey, agentId, entityId, entityName, version, skipConfirmation = false) {
277
- try {
278
- if (!skipConfirmation) {
279
- console.log('\nāš ļø WARNING: You are about to deploy to PRODUCTION!');
280
- console.log('āš ļø This will affect ALL users immediately.\n');
281
- const confirmAnswer = await safePrompt([
282
- {
283
- type: 'confirm',
284
- name: 'confirm',
285
- message: 'Are you absolutely sure you want to deploy?',
286
- default: false,
287
- },
288
- ]);
289
- if (!confirmAnswer || !confirmAnswer.confirm) {
290
- console.log('\nāŒ Deployment cancelled. Version pushed but not deployed.\n');
291
- return false;
292
- }
293
- }
294
- writeProgress(`šŸ”„ Publishing ${handler.displayName} version...`);
295
- writeInfo('ā±ļø Waiting for server to process the new version (3 seconds)...');
296
- await new Promise((resolve) => setTimeout(resolve, 3000));
297
- const deployed = await retryDeploy(async () => {
298
- const result = await handler.publishVersion(apiKey, agentId, entityId, version);
299
- if (!result.success)
300
- throw new Error(result.error || 'Deploy failed');
301
- }, entityName, version, 3);
302
- if (!deployed) {
303
- console.error(`\nāŒ Deploy Error: failed after retries\n`);
304
- // Deploy is a management operation — no execution logs exist for a failed deploy.
305
- // Suggest retrying via the deploy command.
306
- writeTip(`Deploy later with: lua deploy ${handler.kind}`);
307
- return false;
308
- }
309
- writeSuccess(`\nāœ… ${entityName} v${version} deployed to production\n`);
310
- writeInfo(`šŸ’” The new ${handler.displayName} version is now active.`);
311
- return true;
312
- }
313
- catch (error) {
314
- console.error(`\nāŒ Error deploying ${handler.displayName}:`, error);
315
- // Deploy is a management operation — no execution logs exist for a failed deploy.
316
- writeTip(`Deploy later with: lua deploy ${handler.kind}`);
317
- return false;
318
- }
319
- }
320
- /**
321
- * Main push command - pushes a primitive or agent config to the server.
322
- *
323
- * Supports both interactive and non-interactive modes:
324
- * - Interactive: prompts user to select what to push
325
- * - Non-interactive: type provided as argument (e.g., `lua push skill --name mySkill`)
326
- *
327
- * @param type - Optional type: 'skill', 'agent', 'persona', 'webhook', 'job', 'preprocessor', 'postprocessor', 'mcp', 'backup', or 'all'
328
- * @param cmdObj - Commander command object with options
329
- * @returns Promise that resolves when push completes
330
- */
331
- export async function pushCommand(type, cmdObj) {
332
- return withErrorHandling(async () => {
333
- // Extract options from Commander command object
334
- const options = {
335
- force: cmdObj?.force || false,
336
- autoDeploy: cmdObj?.autoDeploy || false,
337
- entityName: cmdObj?.name || null,
338
- version: cmdObj?.setVersion || null,
339
- // Only meaningful for `lua push backup`; ignored for other types.
340
- fresh: cmdObj?.fresh || false,
341
- // Commander's `--no-include-source` registers the flag with default
342
- // `true` and flips it to `false` when the user passes `--no-...`.
343
- // Reading with `!== false` makes the programmatic-default-true path
344
- // explicit: when cmdObj is undefined (rare; programmatic invocation)
345
- // we still default to attaching source.
346
- includeSource: cmdObj?.includeSource !== false,
347
- };
348
- let agentOutcome;
349
- let selectedType;
350
- /** Stats from the optional `--include-source` post-backup hook (Phase 2). */
351
- let trackedIncludeSource;
352
- /** Present only after a versioned-primitive route; indicates production publish success after optional deploy. */
353
- let versionedPushDeployResult;
354
- // Normalize alias first (e.g. 'everything' → 'all', 'skills' → 'skill')
355
- // so that the early 'all' guard below can catch aliases like 'everything'
356
- if (type) {
357
- type = validateOrSuggest('push.type', type, { allowAll: true });
358
- }
359
- // Handle 'all' type with force flag
360
- if (type === 'all') {
361
- if (!options.force) {
362
- console.log('\nUsage:');
363
- console.log(' lua push all --force Push all components without prompts');
364
- console.log(' lua push all --force --auto-deploy Push and deploy all to production');
365
- throw new Error('The "all" type requires the --force flag');
366
- }
367
- return await pushAllCommand(options);
368
- }
369
- // Validate that entityName without type is not allowed
370
- if (options.entityName && !type) {
371
- console.log('\nUsage:');
372
- console.log(' lua push skill --name mySkill --set-version 1.0.5 Push specific skill');
373
- console.log(' lua push webhook --name myWebhook --set-version 2.0.0 Push specific webhook');
374
- throw new Error('Type must be specified when using the --name option.');
375
- }
376
- if (type) {
377
- selectedType = type;
378
- }
379
- else {
380
- // Step 2: Prompt for type selection
381
- const typeAnswer = await safePrompt([
382
- {
383
- type: 'list',
384
- name: 'type',
385
- message: 'What would you like to push?',
386
- choices: [
387
- { name: 'šŸ› ļø Skill', value: 'skill' },
388
- { name: 'šŸŖ Webhook', value: 'webhook' },
389
- { name: 'ā° Job', value: 'job' },
390
- { name: 'šŸ“„ PreProcessor', value: 'preprocessor' },
391
- { name: 'šŸ“¤ PostProcessor', value: 'postprocessor' },
392
- { name: 'šŸ”Œ MCP Server', value: 'mcp' },
393
- { name: 'šŸ“” Device', value: 'device' },
394
- { name: 'šŸ“” Device Trigger', value: 'device-trigger' },
395
- { name: 'šŸ¤– Agent (persona, model)', value: 'agent' },
396
- { name: 'šŸ’¾ Backup (source files)', value: 'backup' },
397
- ],
398
- },
399
- ]);
400
- if (!typeAnswer) {
401
- console.log('Push cancelled.');
402
- return;
403
- }
404
- selectedType = typeAnswer.type;
405
- }
406
- // Step 3: Route to appropriate function
407
- if (selectedType === 'skill') {
408
- versionedPushDeployResult = await pushVersionedPrimitive(skillH, options);
409
- }
410
- else if (selectedType === 'webhook') {
411
- versionedPushDeployResult = await pushVersionedPrimitive(webhookH, options);
412
- }
413
- else if (selectedType === 'job') {
414
- versionedPushDeployResult = await pushVersionedPrimitive(jobH, options);
415
- }
416
- else if (selectedType === 'preprocessor') {
417
- versionedPushDeployResult = await pushVersionedPrimitive(preprocessorH, options);
418
- }
419
- else if (selectedType === 'postprocessor') {
420
- versionedPushDeployResult = await pushVersionedPrimitive(postprocessorH, options);
421
- }
422
- else if (selectedType === 'device') {
423
- versionedPushDeployResult = await pushVersionedPrimitive(deviceH, options);
424
- }
425
- else if (selectedType === 'device-trigger') {
426
- versionedPushDeployResult = await pushVersionedPrimitive(deviceTriggerH, options);
427
- }
428
- else if (selectedType === 'mcp') {
429
- const mcpActivated = await pushMCPServer(options);
430
- // B10: thread activation status so the final hint knows whether MCP is live.
431
- versionedPushDeployResult = { productionDeploySucceeded: mcpActivated };
432
- }
433
- else if (selectedType === 'backup') {
434
- await pushBackupCommand({ force: options.force, fresh: options.fresh });
435
- }
436
- else if (selectedType === 'agent') {
437
- agentOutcome = await pushAgentVersion(options);
438
- }
439
- if (agentOutcome?.cancelled) {
440
- return;
441
- }
442
- // Phase 2 task 2.5: auto-backup-push after every successful primitive push.
443
- // Phase 0 deleted runPostPushHook and left this gap; without it, a `lua
444
- // push <X>` could exit 0 while the corresponding source backup silently
445
- // never made it to S3, leaving the server-deployed code with no way to
446
- // recover its source. We use runBackupPush (not pushBackupCommand) for
447
- // two reasons:
448
- // 1. We need it to throw on failure so the surrounding `lua push`
449
- // exits non-zero — partial success here was the original failure
450
- // mode this is fixing.
451
- // 2. The user-facing wrapper has freshness/server-newer guards that
452
- // make sense for `lua push backup` but would block the auto-hook
453
- // after legitimate primitive pushes.
454
- // Skip for `backup` (the user already pushed it directly) and `agent`
455
- // (no source files change on the agent path).
456
- if (selectedType !== 'backup' && selectedType !== 'agent') {
457
- const hookApiKey = requireAuthOrExit(false);
458
- const hookConfig = readYamlConfig();
459
- const hookAgentId = hookConfig?.agent?.agentId;
460
- if (!hookAgentId) {
461
- throw new Error('Cannot run auto-backup: no agentId in lua.skill.yaml.');
462
- }
463
- // Source backup is a deploy invariant: a successful primitive push
464
- // that doesn't reach the source store leaves `lua init` (and the
465
- // Builder's workspace hydration) seeing stale state on the next
466
- // restore. We exit non-zero on backup failure to surface the gap
467
- // — but the primitive itself is already deployed, so the message
468
- // needs to be explicit about that + point at the recovery action
469
- // so the user doesn't re-push the primitive thinking it failed.
470
- try {
471
- const hookResult = await runBackupPush({
472
- apiKey: hookApiKey,
473
- agentId: hookAgentId,
474
- force: true,
475
- fresh: true,
476
- triggeredBy: `push ${selectedType}${options.entityName ? ` ${options.entityName}` : ''}`,
477
- });
478
- writeInfo(`šŸ’¾ Backup at v${hookResult.activeVersion} (${hookResult.filesUploaded} new file(s))`);
479
- }
480
- catch (err) {
481
- const reason = err instanceof Error ? err.message : String(err);
482
- const label = selectedType + (options.entityName ? ` "${options.entityName}"` : '');
483
- writeError(`Source backup failed after ${label} push: ${reason}\n\n` +
484
- `Your ${label} IS deployed and live on the server — do NOT re-push the primitive.\n` +
485
- `The source backup just didn't sync. Recover with:\n\n` +
486
- ` lua push backup --force --fresh\n\n` +
487
- `Until the backup catches up, \`lua init\` for this agent will restore an older snapshot.`);
488
- throw err;
489
- }
490
- // Per-skill source attach is a denormalized UI projection; failures here
491
- // are non-fatal — the primitive is already deployed and the per-agent
492
- // backup already succeeded. Recover with `lua push --include-source` on
493
- // the next push or the admin dashboard's `hydrate-source` affordance.
494
- if (options.includeSource) {
495
- const sourceAttachStats = await runIncludeSourceHook(hookApiKey, hookAgentId, selectedType);
496
- trackedIncludeSource = sourceAttachStats;
497
- }
498
- }
499
- trackEvent('cli_push_completed', {
500
- primitive_type: selectedType,
501
- force_mode: options.force || false,
502
- auto_deploy: options.autoDeploy || false,
503
- entity_selected_by_name: !!options.entityName,
504
- type_selected_by_arg: !!type,
505
- version_specified: !!options.version,
506
- // BAC-196 presigned-upload telemetry. `bundles_total` = unique
507
- // content-hashes referenced by this push; `bundles_uploaded` = hashes
508
- // the server reported missing and we PUT to S3; `bundles_existed`
509
- // measures delta-upload hit rate. Zero for non-versioned types
510
- // (mcp/agent/backup) — they don't go through the S3 path.
511
- bundles_total: versionedPushDeployResult?.bundleStats?.total ?? 0,
512
- bundles_uploaded: versionedPushDeployResult?.bundleStats?.uploaded ?? 0,
513
- bundles_existed: versionedPushDeployResult?.bundleStats?.alreadyExisted ?? 0,
514
- // Phase 2 `--include-source` telemetry. Tracks adoption of the flag
515
- // and whether the per-skill source attach actually lands cleanly —
516
- // useful for the eventual "flip default to ON" decision in Slice 5.
517
- include_source_requested: options.includeSource || false,
518
- include_source_attempted: trackedIncludeSource?.attempted ?? 0,
519
- include_source_attached: trackedIncludeSource?.attached ?? 0,
520
- include_source_failed: trackedIncludeSource?.failed ?? 0,
521
- });
522
- const productionDeployedActually = versionedPushDeployResult?.productionDeploySucceeded === true ||
523
- (!!agentOutcome && !agentOutcome.cancelled && agentOutcome.productionDeployedWithAutoDeploy);
524
- const personaAutoDeployRanAndFailed = selectedType === 'agent' &&
525
- options.autoDeploy &&
526
- !!agentOutcome &&
527
- !agentOutcome.cancelled &&
528
- 'personaAutoDeployFailed' in agentOutcome &&
529
- agentOutcome.personaAutoDeployFailed;
530
- if (productionDeployedActually) {
531
- writeHintBlock({
532
- headline: 'Deployed to production. Generate test traffic first:',
533
- lines: [
534
- { label: 'Test:', command: `lua chat -e production -m "your test message"` },
535
- { label: 'Inspect:', command: buildLogsCommand({ primitiveType: selectedType }) },
536
- ],
537
- when: 'success',
538
- });
539
- }
540
- else {
541
- const deployHint = getDeployHint(selectedType);
542
- if (personaAutoDeployRanAndFailed) {
543
- const lines = [];
544
- if (deployHint) {
545
- lines.push(deployHint);
546
- }
547
- else if (selectedType === 'mcp') {
548
- lines.push({
549
- label: 'Activate:',
550
- command: 'use the Lua dashboard or: lua push mcp --force --auto-deploy (requires --name when multiple MCP servers)',
551
- });
552
- }
553
- lines.push({
554
- label: 'Or re-push:',
555
- command: selectedType === 'mcp'
556
- ? 'lua push mcp --force --auto-deploy'
557
- : `lua push ${selectedType} --force --auto-deploy`,
558
- });
559
- writeHintBlock({
560
- headline: 'Push completed — production persona deploy did not succeed. Try:',
561
- lines,
562
- when: 'partial',
563
- });
564
- }
565
- else if (selectedType === 'backup') {
566
- // Backup is not a "live" primitive; skip staged-vs-live framing.
567
- }
568
- else if (deployHint) {
569
- writeHintBlock({
570
- headline: 'Staged but NOT live yet. To make it active:',
571
- lines: [deployHint, { label: 'Or re-push:', command: `lua push ${selectedType} --force --auto-deploy` }],
572
- when: 'success',
573
- });
574
- }
575
- else {
576
- writeNextStep({
577
- command: selectedType === 'mcp'
578
- ? 'lua push mcp --force --auto-deploy'
579
- : `lua push ${selectedType} --force --auto-deploy`,
580
- rationale: 'to re-push with auto-activation',
581
- when: 'success',
582
- });
583
- }
584
- }
585
- }, 'push');
586
- }
587
- export async function runIncludeSourceHook(apiKey, agentId, selectedType) {
588
- const stats = { attempted: 0, attached: 0, failed: 0 };
589
- // Outer try/catch enforces the hook's non-fatal contract: any throw from
590
- // the setup steps (FS error in `encodeWorkspaceArchive`, malformed YAML
591
- // from `readYamlConfig`, `new SkillApi` construction failure, etc.) is
592
- // logged as a warning and the hook returns the partial stats. The caller
593
- // `pushCommand` awaits this without a try/catch on purpose — the
594
- // primitive is already deployed and the per-agent backup is current; a
595
- // setup failure in this denormalized UI projection must NOT take down the
596
- // push or skip the `cli_push_completed` telemetry.
597
- try {
598
- // The per-skill source store only exists for skills. Other primitive
599
- // types (webhook, job, processor, mcp) have no `SkillsVersions.sourceArchive`
600
- // equivalent — surface that as a clean no-op so the user knows the flag
601
- // wasn't silently ignored due to an error.
602
- const archive = encodeWorkspaceArchive(process.cwd());
603
- if (!archive) {
604
- writeInfo('šŸ’” --include-source: workspace has no archivable source, skipping');
605
- return stats;
606
- }
607
- const config = readYamlConfig();
608
- const skills = config?.skills ?? [];
609
- if (skills.length === 0) {
610
- if (selectedType !== 'skill') {
611
- writeInfo(`šŸ’” --include-source: no skills in lua.skill.yaml to attach source to (selectedType=${selectedType})`);
612
- }
613
- else {
614
- writeInfo('šŸ’” --include-source: no skills in lua.skill.yaml');
615
- }
616
- return stats;
617
- }
618
- stats.attempted = skills.length;
619
- const skillApi = new SkillApi(BASE_URLS.API, apiKey, agentId);
620
- // Bounded parallelism: 5 concurrent attaches. Each call is small (manifest
621
- // payload + base64 archive), but Promise.all with no limit can hammer the
622
- // proxy on large multi-skill agents. 5 matches the bundle-upload helper's
623
- // default concurrency in lua-cli.
624
- const concurrency = 5;
625
- for (let i = 0; i < skills.length; i += concurrency) {
626
- const batch = skills.slice(i, i + concurrency);
627
- await Promise.all(batch.map(async (skill) => {
628
- try {
629
- const response = await skillApi.attachSkillSource(skill.skillId, skill.version, {
630
- sourceArchive: archive,
631
- archiveSchemaVersion: ARCHIVE_SCHEMA_VERSION,
632
- tools: [],
633
- });
634
- if (response.success) {
635
- stats.attached++;
636
- }
637
- else {
638
- stats.failed++;
639
- writeInfo(` ↳ attach failed for ${skill.name}@${skill.version}: ${response.error?.message ?? 'unknown'}`);
640
- }
641
- }
642
- catch (err) {
643
- stats.failed++;
644
- writeInfo(` ↳ attach failed for ${skill.name}@${skill.version}: ${err instanceof Error ? err.message : String(err)}`);
645
- }
646
- }));
647
- }
648
- if (stats.failed === 0) {
649
- writeInfo(`šŸ’” Source attached to ${stats.attached}/${stats.attempted} skill(s) — Builder UI will reflect CLI edits`);
650
- }
651
- else {
652
- writeError(`--include-source: ${stats.failed}/${stats.attempted} skill source attach(es) failed (non-fatal — primitive is deployed, per-agent backup is current)`);
653
- }
654
- }
655
- catch (err) {
656
- // Setup-step throw (FS / YAML / client construction). Treat as a
657
- // hook-wide failure: surface a warning, return partial stats, never
658
- // propagate. The primitive is deployed; the developer can re-run
659
- // `lua push --include-source` once they fix the underlying issue.
660
- writeError(`--include-source: hook setup failed (non-fatal — primitive is deployed, per-agent backup is current): ${err instanceof Error ? err.message : String(err)}`);
661
- }
662
- return stats;
663
- }
664
- /**
665
- * Steps:
666
- * 1. Compile to get latest manifest
667
- * 2. Show preview of what will be pushed
668
- * 3. Confirm (unless --force)
669
- * 4. Push via agentHandler
670
- * 5. Optionally deploy persona version
671
- */
672
- async function pushAgentVersion(options = {}) {
673
- // Step 1: Compile to get fresh manifest
674
- writeProgress('šŸ”„ Compiling...');
675
- await compileCommand();
676
- const config = readYamlConfig();
677
- if (!config || !config.agent?.agentId) {
678
- throw new Error("No agent configuration found. Please run 'lua init' first.");
679
- }
680
- const manifest = loadManifest();
681
- const agentId = config.agent.agentId;
682
- const agent = getPrimitivesByKind(manifest, PrimitiveKind.AGENT)[0];
683
- const persona = agent?.persona;
684
- const model = agent?.model;
685
- const hasModelResolver = agent?.hasModelResolver;
686
- if (!hasPersonaTextContent(persona) && !model && !hasModelResolver) {
687
- throw new Error('No agent configuration to push (no persona or model found).');
688
- }
689
- writeInfo(`šŸ“¦ Pushing agent config for: ${agentId}`);
690
- // Show preview
691
- if (hasPersonaTextContent(persona)) {
692
- // Channel-agnostic — preview shows the full persona content regardless
693
- // of which channel branches are populated.
694
- const personaText = flattenPersonaTextAll(persona);
695
- const preview = personaText.length > 200 ? personaText.substring(0, 200) + '...' : personaText;
696
- console.log('\nPersona preview:');
697
- console.log(preview);
698
- }
699
- if (model) {
700
- console.log(`\nModel: ${model}`);
701
- }
702
- console.log();
703
- // Confirm (skip if --force)
704
- if (!options.force) {
705
- const confirmAnswer = await safePrompt([
706
- {
707
- type: 'confirm',
708
- name: 'confirm',
709
- message: 'Push agent configuration to server?',
710
- default: true,
711
- },
712
- ]);
713
- if (!confirmAnswer || !confirmAnswer.confirm) {
714
- console.log('\nāŒ Push cancelled.\n');
715
- return { cancelled: true };
716
- }
717
- }
718
- // Authenticate
719
- const apiKey = await authenticateOrFail();
720
- writeProgress('āœ… Authenticated');
721
- // Push via agentHandler
722
- const result = await agentHandler.pushAgentConfig(apiKey, agentId, manifest);
723
- let productionDeployedWithAutoDeploy = false;
724
- let personaDeployWasAttempted = false;
725
- const personaDeployEligible = !!(result.persona?.success && result.persona.version);
726
- // B4: only ask about deploy when a persona was actually pushed — avoid the prompt
727
- // when push failed or was a model-only push with no persona version created.
728
- if (personaDeployEligible) {
729
- const shouldDeploy = await shouldDeployAfterPush(options);
730
- if (shouldDeploy) {
731
- personaDeployWasAttempted = true;
732
- productionDeployedWithAutoDeploy = await deployPersonaVersionAfterPush(apiKey, agentId, result.persona.version, options.autoDeploy || false);
733
- }
734
- else {
735
- writeInfo('šŸ’” You can deploy the persona version later using: lua deploy');
736
- }
737
- }
738
- const personaAutoDeployFailed = Boolean(options.autoDeploy && personaDeployEligible && personaDeployWasAttempted && !productionDeployedWithAutoDeploy);
739
- return { cancelled: false, productionDeployedWithAutoDeploy, personaAutoDeployFailed };
740
- }
741
- /**
742
- * Deploy a persona version immediately after pushing
743
- */
744
- async function deployPersonaVersionAfterPush(apiKey, agentId, versionNum, skipConfirmation = false) {
745
- try {
746
- // Skip confirmation when called from auto-deploy with --force
747
- if (!skipConfirmation) {
748
- // Show warning
749
- console.log('\nāš ļø WARNING: You are about to deploy to PRODUCTION!');
750
- console.log('āš ļø This will affect ALL users immediately.\n');
751
- const confirmAnswer = await safePrompt([
752
- {
753
- type: 'confirm',
754
- name: 'confirm',
755
- message: 'Are you absolutely sure you want to deploy this persona version?',
756
- default: false,
757
- },
758
- ]);
759
- if (!confirmAnswer || !confirmAnswer.confirm) {
760
- console.log('\nāŒ Deployment cancelled. Persona version created but not deployed.\n');
761
- return false;
762
- }
763
- }
764
- writeProgress('šŸ”„ Deploying persona version...');
765
- const personaApi = new PersonaApi(BASE_URLS.API, apiKey, agentId);
766
- const deployResult = await personaApi.deployVersion(versionNum);
767
- if (!deployResult.success) {
768
- console.error(`\nāŒ Deploy Error: ${deployResult.error?.message || 'Unknown error'}\n`);
769
- // Persona deploy is a management operation — no execution logs exist.
770
- writeTip('Retry with: lua push agent');
771
- throw new Error(deployResult.error?.message || 'Failed to deploy persona version');
772
- }
773
- writeSuccess(`\nāœ… Persona version ${versionNum} deployed successfully to production\n`);
774
- writeInfo('šŸ’” The new persona is now active for all users.');
775
- return true;
776
- }
777
- catch (error) {
778
- console.error('\nāŒ Error deploying persona version:', error);
779
- writeTip('Retry with: lua push agent');
780
- return false;
781
- }
782
- }
783
- /**
784
- * Push MCP server (non-versioned, upsert pattern).
785
- * Uses the same compile→auth→config→select pattern as versioned primitives,
786
- * with MCP-specific logic delegated to the handler.
787
- */
788
- async function pushMCPServer(options = {}) {
789
- try {
790
- writeProgress('šŸ“¦ Compiling project...');
791
- await compileCommand();
792
- writeSuccess('āœ… Compilation complete');
793
- const apiKey = await authenticateOrFail();
794
- writeSuccess('āœ… Authentication verified');
795
- const config = readYamlConfig();
796
- if (!config?.agent?.agentId) {
797
- throw new Error("No agent ID found. Run 'lua init' first.");
798
- }
799
- const agentId = config.agent.agentId;
800
- const { mcpServerHandler } = await import('../primitives/mcp-server.handler.js');
801
- const bundledServers = mcpServerHandler.loadBundledItems();
802
- if (bundledServers.length === 0) {
803
- throw new Error('No MCP servers found in compiled output.');
804
- }
805
- const selectedServer = await selectEntityOrFail(bundledServers, options, {
806
- entityType: 'MCP server',
807
- nameFields: ['name'],
808
- formatChoice: (s) => `${s.name} (${s.transport})`,
809
- });
810
- writeProgress(`\nšŸš€ Pushing MCP server "${selectedServer.name}"...`);
811
- // upsertOnServer persists the returned id into lua.skill.yaml on success.
812
- const result = await mcpServerHandler.upsertOnServer(apiKey, agentId, selectedServer);
813
- if (!result.success) {
814
- // Push rejected — reason already on screen; no execution logs exist for a failed push.
815
- throw new Error(`Failed: ${result.error}`);
816
- }
817
- writeSuccess(`\nāœ… MCP server "${selectedServer.name}" pushed successfully\n`);
818
- let activated = false;
819
- if (result.id && (await shouldDeployAfterPush(options))) {
820
- writeProgress('šŸ”„ Activating MCP server...');
821
- const activateResult = await mcpServerHandler.activate(apiKey, agentId, result.id);
822
- if (activateResult.success) {
823
- writeSuccess(`āœ… MCP server activated\n`);
824
- activated = true;
825
- }
826
- }
827
- return activated;
828
- }
829
- catch (error) {
830
- throw error;
831
- }
832
- return false; // unreachable — catch always rethrows
833
- }
834
- /**
835
- * Push all command - Pushes all components (skills, webhooks, jobs, processors) without prompts
836
- *
837
- * This command:
838
- * 1. Compiles the project
839
- * 2. Reads lua.skill.yaml to get all components
840
- * 3. Auto-bumps patch versions
841
- * 4. Pushes all components
842
- * 5. Optionally auto-deploys to production
843
- *
844
- * @param options - Command options (force is required, autoDeploy is optional)
845
- */
846
- async function pushAllCommand(options) {
847
- writeProgress('šŸš€ Push All - Pushing all components to server...\n');
848
- if (options.autoDeploy) {
849
- writeInfo('šŸš€ Auto-deploy to production is ENABLED\n');
850
- }
851
- // Step 1: Compile first
852
- writeProgress('šŸ“¦ Compiling project...');
853
- await compileCommand();
854
- // Step 2: Load configuration and API key
855
- const config = readYamlConfig();
856
- if (!config?.agent?.agentId) {
857
- throw new Error('No agent ID found in lua.skill.yaml. Run "lua init" first.');
858
- }
859
- const apiKey = await requireAuthOrExit(false);
860
- const agentId = config.agent.agentId;
861
- // Step 3: Load manifest
862
- let manifest;
863
- try {
864
- manifest = loadManifest();
865
- }
866
- catch (error) {
867
- throw new Error(`Compilation output not found. Compilation may have failed. ${error.message}`);
868
- }
869
- // Track results and deploy queue per handler
870
- const allResults = [];
871
- const toDeploy = [];
872
- // Per-item failures collected across all push surfaces (versioned
873
- // primitives + MCP). Drives the post-run aggregate `āš ļø N component(s)
874
- // failed` block and the final partial/error writeNextStep variant.
875
- const failedItems = [];
876
- let deployFailedCount = 0;
877
- let personaPushResult = null;
878
- let backupSuccess = false;
879
- // Captured after the per-skill source-attach hook (when `--include-source`
880
- // is set), so the run's `cli_push_completed` event below carries the
881
- // include-source adoption fields for the `lua push all` path too.
882
- let includeSourceStats;
883
- // BAC-196: aggregate bundle-upload stats across all primitives in the run.
884
- const bundleStatsAggregate = { total: 0, uploaded: 0, existed: 0 };
885
- // Icons per kind for display
886
- const kindIcons = {
887
- skill: 'šŸ“¦',
888
- webhook: 'šŸŖ',
889
- job: 'ā°',
890
- preprocessor: 'šŸ“„',
891
- postprocessor: 'šŸ“¤',
892
- device: 'šŸ“”',
893
- };
894
- // Step 4: Pre-fetch highest versions in parallel (one HTTP call per handler type)
895
- const handlers = [
896
- skillH,
897
- webhookH,
898
- jobH,
899
- preprocessorH,
900
- postprocessorH,
901
- deviceH,
902
- deviceTriggerH,
903
- ];
904
- // Collect entity IDs per handler and batch-fetch versions in parallel
905
- const handlerItems = handlers
906
- .map((handler) => ({
907
- handler,
908
- items: handler.getFromYaml(config).filter((item) => {
909
- const entityId = item[handler.yamlConfig.idField];
910
- return entityId && item.version;
911
- }),
912
- }))
913
- .filter((h) => h.items.length > 0);
914
- const versionMaps = await Promise.all(handlerItems.map(async ({ handler, items }) => {
915
- const entityIds = items.map((item) => item[handler.yamlConfig.idField]);
916
- const versions = await handler.batchGetHighestVersions(apiKey, agentId, entityIds);
917
- return { handler, versions };
918
- }));
919
- const versionLookup = new Map();
920
- for (const { handler, versions } of versionMaps) {
921
- versionLookup.set(handler, versions);
922
- }
923
- // Step 5: Push all versioned primitives (versions already pre-fetched)
924
- for (const handler of handlers) {
925
- const items = handler.getFromYaml(config);
926
- if (items.length === 0)
927
- continue;
928
- const icon = kindIcons[handler.kind] || 'šŸ“¦';
929
- writeProgress(`\n${icon} Pushing ${items.length} ${handler.displayName}(s)...`);
930
- const handlerVersions = versionLookup.get(handler);
931
- for (const item of items) {
932
- try {
933
- const bundleAccumulator = new Map();
934
- const pushData = handler.prepareForPush(manifest, item.name, undefined, bundleAccumulator);
935
- if (!pushData) {
936
- console.warn(`āš ļø ${handler.displayName} "${item.name}" not found in compiled output, skipping`);
937
- continue;
938
- }
939
- if (bundleAccumulator.size > 0) {
940
- const stats = await ensureBundlesUploaded(apiKey, agentId, bundleAccumulator);
941
- bundleStatsAggregate.total += stats.total;
942
- bundleStatsAggregate.uploaded += stats.uploaded;
943
- bundleStatsAggregate.existed += stats.alreadyExisted;
944
- }
945
- const entityId = item[handler.yamlConfig.idField];
946
- if (!entityId) {
947
- console.warn(`āš ļø ${handler.displayName} "${item.name}" has no server ID, skipping. Run 'lua compile' first.`);
948
- continue;
949
- }
950
- if (!item.version) {
951
- console.warn(`āš ļø ${handler.displayName} "${item.name}" has no version, skipping`);
952
- continue;
953
- }
954
- // Auto-bump version (use pre-fetched server version to avoid conflicts)
955
- const serverHighest = handlerVersions?.get(entityId) ?? null;
956
- const baseVersion = serverHighest ? maxSemver(item.version, serverHighest) : item.version;
957
- let newVersion = incrementPatchVersion(baseVersion);
958
- writeInfo(` šŸ“ ${item.name}: ${item.version} → ${newVersion}`);
959
- // Push
960
- let result = await handler.pushToServer(apiKey, agentId, entityId, { ...pushData, version: newVersion });
961
- // On version collision, re-fetch the server's current highest version
962
- // and try once more. The pre-fetch in step 4 is racey against
963
- // concurrent pushes by the same/another user; a single re-bump
964
- // resolves the dominant collision pattern observed in production.
965
- if (!result.success && result.error?.toLowerCase().includes('already exists')) {
966
- console.log(` āš ļø Version collision on ${item.name}, refetching server state and retrying...`);
967
- const freshHighest = await handler.getHighestServerVersion(apiKey, agentId, entityId);
968
- if (freshHighest) {
969
- const retryVersion = incrementPatchVersion(freshHighest);
970
- writeInfo(` šŸ“ ${item.name}: re-bumped ${newVersion} → ${retryVersion} after collision`);
971
- result = await handler.pushToServer(apiKey, agentId, entityId, { ...pushData, version: retryVersion });
972
- if (result.success) {
973
- newVersion = retryVersion;
974
- }
975
- }
976
- }
977
- if (!result.success) {
978
- console.error(` āŒ Failed to push ${item.name}: ${result.error}`);
979
- failedItems.push({ kind: handler.kind, name: item.name, error: result.error || 'Unknown error' });
980
- continue;
981
- }
982
- handler.updateVersionInYaml(item.name, newVersion, { silent: true });
983
- allResults.push({ handler, name: item.name, version: newVersion, entityId });
984
- writeSuccess(` āœ… ${item.name} v${newVersion} pushed`);
985
- if (options.autoDeploy) {
986
- toDeploy.push({ handler, name: item.name, version: newVersion, entityId });
987
- }
988
- }
989
- catch (error) {
990
- // Auth errors must propagate so withErrorHandling treats them as
991
- // fatal, otherwise the loop continues against a known-broken auth
992
- // state. Matches the re-throw pattern in batchGetHighestVersions /
993
- // getHighestServerVersion.
994
- if (AuthenticationError.isAuthenticationError(error))
995
- throw error;
996
- console.error(` āŒ Failed to push ${item.name}: ${error.message}`);
997
- failedItems.push({ kind: handler.kind, name: item.name, error: error.message || 'Unknown error' });
998
- }
999
- }
1000
- }
1001
- // Step 6: Push MCP server configurations (non-versioned, upsert-by-name).
1002
- // push.ts loads bundled servers once and hands them to pushAll, which
1003
- // upserts each, persists returned ids into lua.skill.yaml, and activates
1004
- // when --auto-deploy is set. Here we only print the summary.
1005
- const { mcpServerHandler: mcpH } = await import('../primitives/mcp-server.handler.js');
1006
- const bundledMcp = mcpH.loadBundledItems();
1007
- let mcpPushedCount = 0; // tracks actual successes, not just attempts (B2)
1008
- if (bundledMcp.length > 0) {
1009
- writeProgress(`\nšŸ”Œ Pushing ${bundledMcp.length} MCP server(s)...`);
1010
- const mcpResult = await mcpH.pushAll(bundledMcp, apiKey, agentId, { autoDeploy: options.autoDeploy });
1011
- mcpPushedCount = mcpResult.pushed.length;
1012
- for (const name of mcpResult.pushed) {
1013
- writeSuccess(` āœ… ${name}`);
1014
- if (mcpResult.activated.includes(name))
1015
- writeSuccess(` šŸ”Œ Auto-activated`);
1016
- }
1017
- for (const { name, error } of mcpResult.failed) {
1018
- console.error(` āŒ Failed to push ${name}: ${error}`);
1019
- failedItems.push({ kind: 'mcp', name, error: error || 'Unknown error' });
1020
- }
1021
- }
1022
- // Aggregate failure block: emit a single grouped summary with a per-item
1023
- // `lua logs` diagnose hint so users can jump straight to the failing
1024
- // component's logs without scrolling back through interleaved push output.
1025
- // Printed before agent config push so the user sees component failures
1026
- // alongside the persona/backup status that follows.
1027
- if (failedItems.length > 0) {
1028
- console.error(formatPushFailureSummary(failedItems));
1029
- }
1030
- // Step 6.5: Push agent config (persona, model/modelResolver)
1031
- const agentPushResult = await agentHandler.pushAgentConfig(apiKey, agentId, manifest);
1032
- if (agentPushResult.persona?.success) {
1033
- personaPushResult = { version: agentPushResult.persona.version };
1034
- }
1035
- // Persona push creates a new version but doesn't activate it. Without
1036
- // --auto-deploy the dashboard keeps showing the previously-deployed
1037
- // version, which is surprising since other primitives feel "live" after
1038
- // push. Mirror the hint that `push agent` already prints.
1039
- if (personaPushResult && !options.autoDeploy) {
1040
- writeInfo(`šŸ’” Persona v${personaPushResult.version} pushed but not active on the dashboard yet.`);
1041
- writeInfo(' Run `lua deploy` or re-push with `--auto-deploy` to activate it.');
1042
- }
1043
- // Step 7: Deploy all queued components
1044
- if (options.autoDeploy && toDeploy.length > 0) {
1045
- writeProgress('\nšŸš€ Deploying all pushed versions to production...');
1046
- writeInfo('ā±ļø Waiting for server to process versions (5 seconds)...\n');
1047
- await new Promise((resolve) => setTimeout(resolve, 5000));
1048
- for (const item of toDeploy) {
1049
- const deployed = await retryDeploy(async () => {
1050
- const result = await item.handler.publishVersion(apiKey, agentId, item.entityId, item.version);
1051
- if (!result.success)
1052
- throw new Error(result.error || 'Deploy failed');
1053
- }, item.name, item.version, 3);
1054
- if (deployed) {
1055
- writeSuccess(` šŸš€ ${item.name} v${item.version} deployed`);
1056
- }
1057
- else {
1058
- console.warn(` āš ļø ${item.name} deployment failed`);
1059
- deployFailedCount++;
1060
- }
1061
- }
1062
- }
1063
- // Deploy persona if pushed and autoDeploy is on
1064
- if (personaPushResult && options.autoDeploy) {
1065
- const deployed = await retryDeploy(async () => {
1066
- const personaApi = new PersonaApi(BASE_URLS.API, apiKey, agentId);
1067
- const deployResult = await personaApi.deployVersion(personaPushResult.version);
1068
- if (!deployResult.success)
1069
- throw new Error(deployResult.error?.message || 'Deploy failed');
1070
- }, 'persona', String(personaPushResult.version), 3);
1071
- if (deployed) {
1072
- writeSuccess(` šŸš€ Persona v${personaPushResult.version} deployed`);
1073
- }
1074
- else {
1075
- console.warn(` āš ļø Persona deployment failed`);
1076
- deployFailedCount++;
1077
- }
1078
- }
1079
- // Step 7.5: Push source backup. No try/catch — a backup failure must fail
1080
- // the whole `lua push all` so the server's source backup never silently
1081
- // falls out-of-date with a deployed primitive.
1082
- writeProgress('\nšŸ’¾ Pushing source backup...');
1083
- {
1084
- const hookApiKey = requireAuthOrExit(false);
1085
- const hookConfig = readYamlConfig();
1086
- const hookAgentId = hookConfig?.agent?.agentId;
1087
- if (!hookAgentId) {
1088
- throw new Error('Cannot run auto-backup: no agentId in lua.skill.yaml.');
1089
- }
1090
- try {
1091
- const hookResult = await runBackupPush({
1092
- apiKey: hookApiKey,
1093
- agentId: hookAgentId,
1094
- force: true,
1095
- fresh: true,
1096
- triggeredBy: 'batch push',
1097
- });
1098
- writeInfo(`šŸ’¾ Backup at v${hookResult.activeVersion} (${hookResult.filesUploaded} new file(s))`);
1099
- backupSuccess = true;
1100
- }
1101
- catch (err) {
1102
- const reason = err instanceof Error ? err.message : String(err);
1103
- writeError(`Source backup failed after batch push: ${reason}\n\n` +
1104
- `All primitives in this batch ARE deployed and live on the server — do NOT re-push.\n` +
1105
- `The source backup just didn't sync. Recover with:\n\n` +
1106
- ` lua push backup --force --fresh\n\n` +
1107
- `Until the backup catches up, \`lua init\` for this agent will restore an older snapshot.`);
1108
- throw err;
1109
- }
1110
- // Non-fatal — primitives + per-agent backup are already live. Capture
1111
- // the stats so the run's `cli_push_completed` event below reports the
1112
- // include-source outcome for the `lua push all` path too; otherwise
1113
- // the multi-skill batch (the highest-volume path) is invisible to the
1114
- // adoption telemetry we set up for the single-push flow.
1115
- if (options.includeSource) {
1116
- includeSourceStats = await runIncludeSourceHook(hookApiKey, hookAgentId, 'all');
1117
- }
1118
- }
1119
- // Step 8: Print summary
1120
- writeSuccess('\nāœ… Push All Complete!\n');
1121
- // Group results by kind for display
1122
- const byKind = new Map();
1123
- for (const r of allResults) {
1124
- const kind = r.handler.displayNamePlural;
1125
- if (!byKind.has(kind))
1126
- byKind.set(kind, []);
1127
- byKind.get(kind).push(r);
1128
- }
1129
- const summaryIcons = {
1130
- skills: 'šŸ› ļø ',
1131
- webhooks: 'šŸŖ',
1132
- jobs: 'ā°',
1133
- preprocessors: 'šŸ“„',
1134
- postprocessors: 'šŸ“¤',
1135
- };
1136
- for (const [kind, items] of byKind) {
1137
- const icon = summaryIcons[kind] || 'šŸ“¦';
1138
- console.log(`${icon} ${kind.charAt(0).toUpperCase() + kind.slice(1)} (${items.length}):`);
1139
- items.forEach((i) => console.log(` • ${i.name} v${i.version}`));
1140
- }
1141
- if (personaPushResult) {
1142
- console.log(`šŸŒ™ Persona:`);
1143
- console.log(` • Version ${personaPushResult.version} created`);
1144
- }
1145
- if (backupSuccess) {
1146
- console.log(`šŸ’¾ Backup:`);
1147
- console.log(` • Source files pushed`);
1148
- }
1149
- if (options.autoDeploy) {
1150
- writeSuccess('\nšŸš€ All components deployed to production!');
1151
- }
1152
- const kindCounts = {};
1153
- for (const [kind, items] of byKind) {
1154
- kindCounts[kind] = items.length;
1155
- }
1156
- trackEvent('cli_push_completed', {
1157
- primitive_type: 'all',
1158
- force_mode: true,
1159
- auto_deploy: options.autoDeploy || false,
1160
- primitives_pushed_count: allResults.length,
1161
- primitives_by_kind: kindCounts,
1162
- mcp_servers_pushed: mcpPushedCount,
1163
- persona_pushed: !!personaPushResult,
1164
- backup_pushed: backupSuccess,
1165
- // BAC-196 presigned-upload telemetry, summed across every primitive
1166
- // pushed in this run. `bundles_existed` measures delta-upload hit rate.
1167
- bundles_total: bundleStatsAggregate.total,
1168
- bundles_uploaded: bundleStatsAggregate.uploaded,
1169
- bundles_existed: bundleStatsAggregate.existed,
1170
- // Phase 2 `--include-source` telemetry, parallel to the single-push
1171
- // `cli_push_completed` shape. Without these the `lua push all` path —
1172
- // arguably the highest-volume one for multi-skill agents — would be
1173
- // invisible to adoption monitoring.
1174
- include_source_requested: options.includeSource || false,
1175
- include_source_attempted: includeSourceStats?.attempted ?? 0,
1176
- include_source_attached: includeSourceStats?.attached ?? 0,
1177
- include_source_failed: includeSourceStats?.failed ?? 0,
1178
- });
1179
- // B2: use actual successful MCP pushes, not attempt count, to determine pushedSomething.
1180
- const pushedSomething = allResults.length > 0 || mcpPushedCount > 0 || !!personaPushResult || backupSuccess;
1181
- // Pick the right hint variant based on the run outcome. We deliberately
1182
- // ungate the tip from `pushedSomething` for the all-failed case so a
1183
- // 100%-failed `lua push all --force` still surfaces a `lua logs` nudge
1184
- // (previously it was silent, leaving users to guess what to do next).
1185
- const variant = pickPushAllNextStepVariant({
1186
- pushedSomething,
1187
- failedCount: failedItems.length + deployFailedCount,
1188
- });
1189
- if (variant === 'success') {
1190
- console.log('');
1191
- if (options.autoDeploy) {
1192
- writeHintBlock({
1193
- headline: 'All deployed. Generate test traffic first, then inspect:',
1194
- lines: [
1195
- { label: 'Test:', command: 'lua chat -e production -m "your test message"' },
1196
- { label: 'Inspect:', command: buildLogsCommand({ limit: 10 }) },
1197
- ],
1198
- when: 'success',
1199
- });
1200
- }
1201
- else {
1202
- writeHintBlock({
1203
- headline: 'Code staged but NOT live. Make it active:',
1204
- lines: [
1205
- { label: 'Deploy all:', command: 'lua deploy all --force' },
1206
- { label: 'Or re-push:', command: 'lua push all --force --auto-deploy' },
1207
- ],
1208
- when: 'success',
1209
- });
1210
- }
1211
- }
1212
- else if (variant === 'partial') {
1213
- console.log('');
1214
- // Some components pushed, some failed. Suggest re-pushing the failures.
1215
- // No lua logs hint: failed pushes produce no execution logs.
1216
- writeNextStep({
1217
- command: 'lua push all --force',
1218
- rationale: 'to re-attempt the failed components',
1219
- when: 'partial',
1220
- });
1221
- }
1222
- else if (variant === 'error') {
1223
- console.log('');
1224
- // Total failure — nothing pushed, no execution logs exist.
1225
- // No hint: the errors are already shown above.
1226
- }
1227
- }
1228
- /**
1229
- * Retry deployment with exponential backoff
1230
- * The server needs time to process pushed versions before they can be deployed
1231
- */
1232
- async function retryDeploy(deployFn, _componentName, _version, maxRetries = 3) {
1233
- for (let attempt = 1; attempt <= maxRetries; attempt++) {
1234
- try {
1235
- // Only delay on retry attempts (not first attempt)
1236
- if (attempt > 1) {
1237
- const delay = attempt * 2000; // 2s on 2nd attempt, 4s on 3rd, etc.
1238
- await new Promise((resolve) => setTimeout(resolve, delay));
1239
- }
1240
- await deployFn();
1241
- // Show success message if succeeded after retrying
1242
- if (attempt > 1) {
1243
- writeInfo(` āœ“ Succeeded on retry ${attempt}/${maxRetries}`);
1244
- }
1245
- return true;
1246
- }
1247
- catch (error) {
1248
- // Extract detailed error message from API response
1249
- const errorMessage = error?.error?.message || error?.message || 'Unknown error';
1250
- if (attempt < maxRetries) {
1251
- // Intermediate retry - show brief info
1252
- writeInfo(` [Attempt ${attempt}/${maxRetries}] ${errorMessage} - retrying...`);
1253
- }
1254
- else {
1255
- // Final attempt failed - show error
1256
- console.error(` āŒ [Attempt ${attempt}/${maxRetries}] Deploy failed: ${errorMessage}`);
1257
- }
1258
- }
1259
- }
1260
- return false;
1261
- }
1262
- //# sourceMappingURL=push.js.map