lua-cli 3.15.3 → 3.16.0

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 +41174 -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 +1 -1
  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,802 +0,0 @@
1
- /**
2
- * Sync Command
3
- * Detects drift between server state and local code, allowing users to sync
4
- */
5
- import { flattenPersonaTextAll } from '@lua/shared-types';
6
- import fs from 'fs';
7
- import path from 'path';
8
- import { withErrorHandling, writeProgress, writeSuccess, writeInfo, writeError, writeHintBlock, } from '../utils/cli.js';
9
- import { safePrompt } from '../utils/prompt-handler.js';
10
- import { initializeCommand } from '../utils/command-utils.js';
11
- import { compileCommand } from './compile.js';
12
- import { buildLogsCommand } from './log-tip.js';
13
- import { showPersonaDiff, showNameDiff, showModelDiff, showGovernanceDiff } from '../utils/sync-helpers.js';
14
- import { agentHandler } from '../primitives/agent.handler.js';
15
- import { trackEvent } from '../services/analytics.js';
16
- import { checkPrimitiveDrift } from '../utils/sync-fetch.js';
17
- import { showPrimitiveDrift, showPrimitiveDriftSummary } from '../utils/sync-display.js';
18
- import { checkBackupAvailability, restoreFromBackupForSync, detectLocalConflictsForPull, fetchBackupManifestForPull, } from '../utils/backup-helpers.js';
19
- import { readYamlConfig } from '../utils/files.js';
20
- import { mcpServerHandler } from '../primitives/mcp-server.handler.js';
21
- // ─────────────────────────────────────────────────────────────────────────────
22
- // Main Command Entry
23
- // ─────────────────────────────────────────────────────────────────────────────
24
- /**
25
- * Main sync command - detects and resolves drift between server and local code.
26
- *
27
- * Supports both interactive and non-interactive modes:
28
- * - Interactive: prompts for resolution of each drifted component
29
- * - Non-interactive (--check): just check for drift, exit with code 1 if found
30
- * - Non-interactive (--accept): auto-accept server state without prompting (pull from server)
31
- * - Non-interactive (--push): keep local changes without prompting (for pushing to server)
32
- */
33
- export async function syncCommand(options) {
34
- return withErrorHandling(async () => {
35
- // Snapshot YAML versions BEFORE compile runs. `compileCommand()` invokes
36
- // each handler's `applySyncToYaml`, which bumps local primitive versions
37
- // to match the server's active version (see base.handler.ts version
38
- // update block). If we let that run and then read yaml, the drift check
39
- // compares server-against-server and always reports no drift — even when
40
- // the local source code is stale. Then `restoreFromBackupForSync` never
41
- // runs and the user's pull silently does nothing. Capturing versions
42
- // before compile preserves the true local state for drift detection.
43
- const preCompileYaml = readYamlConfig();
44
- // Snapshot raw yaml BYTES pre-compile so we can revert on abort. Compile's
45
- // yaml-sync mutates lua.skill.yaml on disk regardless of whether the
46
- // surrounding sync command ultimately completes. Without a revert, an
47
- // aborted `sync --pull` (e.g., guard rejection, restore failure, network
48
- // error) leaves yaml pre-bumped and the NEXT `sync --pull` sees disk ==
49
- // server and exits with "No drift detected" — silently skipping the
50
- // restore the user actually wanted. Restoring the pre-compile bytes in a
51
- // finally block keeps drift detection correct across retries.
52
- const yamlPath = path.resolve(process.cwd(), 'lua.skill.yaml');
53
- const preCompileYamlBytes = fs.existsSync(yamlPath) ? fs.readFileSync(yamlPath, 'utf-8') : null;
54
- let syncCompletedSuccessfully = false;
55
- try {
56
- writeProgress('šŸ”„ Compiling to get latest local state...');
57
- await compileCommand();
58
- writeProgress('šŸ”„ Checking for drift between server and local code...');
59
- // Initialize command (validates config + auth)
60
- const { agentId, apiKey } = await initializeCommand({ showProgress: false });
61
- const context = { apiKey, agentId };
62
- // Drift check uses the pre-compile snapshot so that compile's yaml
63
- // version bumps don't mask true version drift. Everything downstream
64
- // (restore, writeback, MCP sync) is keyed off primitive names, not
65
- // versions, so using the snapshot here doesn't otherwise skew behavior.
66
- const [drift, primitiveDrift] = await Promise.all([
67
- agentHandler.checkDrift(apiKey, agentId),
68
- preCompileYaml
69
- ? checkPrimitiveDrift(apiKey, agentId, preCompileYaml)
70
- : Promise.resolve({ items: [], hasDrift: false }),
71
- ]);
72
- // Check backup availability only when drift includes items that restore from backup.
73
- // MCP servers pull live from the server, not from source backup — skip the HTTP call
74
- // when drift is MCP-only.
75
- const needsBackup = primitiveDrift.items.some((item) => item.type !== 'mcpServer');
76
- if (primitiveDrift.hasDrift && needsBackup) {
77
- const backupStatus = await checkBackupAvailability(apiKey, agentId);
78
- primitiveDrift.backupAvailable = backupStatus.available;
79
- }
80
- const hasAnyDrift = agentHandler.hasDrift(drift) || primitiveDrift.hasDrift;
81
- // No drift detected
82
- if (!hasAnyDrift) {
83
- writeSuccess('āœ… No drift detected. Local code is in sync with server.');
84
- trackEvent('cli_sync_completed', { has_drift: false });
85
- syncCompletedSuccessfully = true;
86
- return;
87
- }
88
- const mode = options?.check ? 'check' : options?.accept ? 'accept' : options?.push ? 'push' : 'interactive';
89
- let pullConflictCount = 0;
90
- // Execute based on mode
91
- if (options?.check) {
92
- executeCheckMode(drift, primitiveDrift);
93
- }
94
- else if (options?.accept) {
95
- const acceptResult = await executeAcceptMode(context, drift, primitiveDrift, options.force === true);
96
- pullConflictCount = acceptResult.pullConflictCount;
97
- }
98
- else if (options?.push) {
99
- await executePushMode(context, drift, primitiveDrift);
100
- }
101
- else {
102
- await executeInteractiveMode(context, drift, primitiveDrift);
103
- }
104
- trackEvent('cli_sync_completed', {
105
- mode,
106
- has_drift: hasAnyDrift,
107
- name_drift: !!drift.name,
108
- persona_drift: !!drift.persona,
109
- model_drift: !!drift.model,
110
- primitive_drift: primitiveDrift.hasDrift,
111
- primitive_drift_count: primitiveDrift.items.length,
112
- pull_force: options?.force === true && options?.accept === true,
113
- pull_conflict_count: pullConflictCount,
114
- });
115
- syncCompletedSuccessfully = true;
116
- }
117
- finally {
118
- // Revert yaml to pre-compile state if we bailed mid-flight. Best-effort:
119
- // swallow any filesystem error so we don't mask the original abort's
120
- // exception. On success (syncCompletedSuccessfully === true) we leave
121
- // disk alone — compile's yaml updates are the intended final state.
122
- if (!syncCompletedSuccessfully && preCompileYamlBytes !== null) {
123
- try {
124
- fs.writeFileSync(yamlPath, preCompileYamlBytes, 'utf-8');
125
- }
126
- catch {
127
- // Deliberate: do not throw from finally.
128
- }
129
- }
130
- }
131
- }, 'sync');
132
- }
133
- // ─────────────────────────────────────────────────────────────────────────────
134
- // Non-Interactive Modes
135
- // ─────────────────────────────────────────────────────────────────────────────
136
- /**
137
- * Check mode: Display drift summary and exit with code 1 if drift found.
138
- */
139
- function executeCheckMode(drift, primitiveDrift) {
140
- console.log('\n' + '='.repeat(60));
141
- console.log('šŸ” Drift Check Summary');
142
- console.log('='.repeat(60) + '\n');
143
- let driftCount = 0;
144
- if (drift.name) {
145
- driftCount++;
146
- console.log('āš ļø Name drift detected:');
147
- console.log(` Local: "${drift.name.localName || '(empty)'}"`);
148
- console.log(` Server: "${drift.name.serverName || '(empty)'}"`);
149
- console.log();
150
- }
151
- if (drift.persona) {
152
- driftCount++;
153
- const localPersona = flattenPersonaTextAll(drift.persona.localPersona) || '';
154
- const serverPersona = flattenPersonaTextAll(drift.persona.serverPersona) || '';
155
- const localPreview = localPersona
156
- ? localPersona.length > 50
157
- ? localPersona.substring(0, 50) + '...'
158
- : localPersona
159
- : '(empty)';
160
- const serverPreview = serverPersona
161
- ? serverPersona.length > 50
162
- ? serverPersona.substring(0, 50) + '...'
163
- : serverPersona
164
- : '(empty)';
165
- console.log('āš ļø Persona drift detected:');
166
- console.log(` Local: "${localPreview}"`);
167
- console.log(` Server: "${serverPreview}"`);
168
- console.log();
169
- }
170
- if (drift.model) {
171
- driftCount++;
172
- console.log('āš ļø Model drift detected:');
173
- console.log(` Local: "${drift.model.localModel || '(empty)'}"`);
174
- console.log(` Server: "${drift.model.serverModel || '(empty)'}"`);
175
- console.log();
176
- }
177
- if (primitiveDrift.hasDrift) {
178
- showPrimitiveDriftSummary(primitiveDrift.items);
179
- console.log();
180
- }
181
- const totalDrift = driftCount + primitiveDrift.items.length;
182
- if (drift.governance) {
183
- driftCount++;
184
- const localMode = drift.governance.localGovernance?.mode || '(none)';
185
- const serverMode = drift.governance.serverGovernance?.mode || '(none)';
186
- console.log('āš ļø Governance drift detected:');
187
- console.log(` Local: ${localMode} mode`);
188
- console.log(` Server: ${serverMode} mode`);
189
- console.log();
190
- }
191
- console.log('='.repeat(60));
192
- console.log(`Total: ${totalDrift} component(s) with drift`);
193
- console.log("\nšŸ’” Use 'lua sync --push' to push local changes to server");
194
- console.log(" Use 'lua sync --accept' to pull server state to local");
195
- console.log(" Use 'lua sync' for interactive resolution\n");
196
- throw new Error('Operation failed');
197
- }
198
- /**
199
- * Accept mode: Auto-accept server state for all drifted components.
200
- */
201
- async function executeAcceptMode(context, drift, primitiveDrift, force) {
202
- console.log('\nāš ļø Drift detected. Auto-accepting server state...\n');
203
- let unresolvedCount = 0;
204
- let pullConflictCount = 0;
205
- const pullableItems = primitiveDrift.hasDrift
206
- ? primitiveDrift.items.filter((item) => item.status !== 'missing-on-server')
207
- : [];
208
- const pullableMcp = pullableItems.filter((item) => item.type === 'mcpServer');
209
- const pullableSource = pullableItems.filter((item) => item.type !== 'mcpServer');
210
- // Write order matters. The backup restore and the agent-field pulls both
211
- // touch `src/index.ts`: the restore writes whatever was on disk during the
212
- // last `lua push backup` (older persona/name/model), while the agent-field
213
- // pulls AST-edit it with the current server values. The restore must run
214
- // FIRST so the pulls land on top — otherwise the backup silently reverts
215
- // the persona the user just pulled (bug: "persona appears for half a
216
- // second, then reverts").
217
- //
218
- // The guard must also run before any writes so it hashes unmodified disk
219
- // state; keeping it here preserves that invariant.
220
- let manifest = null;
221
- const willRestoreSources = pullableSource.length > 0 && primitiveDrift.backupAvailable;
222
- if (willRestoreSources) {
223
- const fetch = await fetchBackupManifestForPull(context.apiKey, context.agentId);
224
- manifest = fetch.fetched;
225
- const incomingFiles = manifest?.files ?? [];
226
- if (manifest && incomingFiles.length > 0) {
227
- writeProgress('šŸ“„ Checking for local changes before pulling...');
228
- const guard = detectLocalConflictsForPull(incomingFiles);
229
- pullConflictCount = guard.conflicts.length;
230
- if (!force && guard.warning === 'no-tracking') {
231
- writeInfo('āš ļø No local backup tracking found.');
232
- writeInfo(' Cannot detect local changes — proceeding without conflict check.');
233
- writeInfo(' Run `lua push backup` after pulling if you want this check enabled next time.');
234
- }
235
- else if (!force && guard.conflicts.length > 0) {
236
- console.log();
237
- writeError(`āŒ Refusing to pull — ${guard.conflicts.length} local file(s) have uncommitted changes since your last push:`);
238
- for (const p of guard.conflicts) {
239
- writeError(` - ${p}`);
240
- }
241
- console.log();
242
- writeInfo('Your options:');
243
- writeInfo(' • Save your changes: lua push backup (then re-run lua sync --pull)');
244
- writeInfo(' • Overwrite them: lua sync --pull --force (destructive — cannot be undone)');
245
- writeInfo(' • Resolve manually: edit or revert each file, then re-run');
246
- console.log();
247
- writeInfo('Sync aborted. No files were modified.');
248
- throw new Error(`Sync aborted: ${guard.conflicts.length} local file(s) have uncommitted changes`);
249
- }
250
- }
251
- else if (!force && !manifest) {
252
- writeInfo('āš ļø Could not verify local backup (network or server error).');
253
- writeInfo(' Proceeding without conflict check.');
254
- }
255
- }
256
- // Guard passed (or didn't run) — safe to proceed with writes.
257
- // Primitive drift first: MCP servers pull live from the server (handler
258
- // owns its YAML sync); source-based primitives (skills/webhooks/jobs/
259
- // pre-post-processors) restore from S3 backup. Both happen before the
260
- // agent-field pulls so the restore cannot clobber them (see comment above).
261
- if (primitiveDrift.hasDrift) {
262
- if (pullableMcp.length > 0) {
263
- writeProgress('šŸ“„ Syncing MCP servers from server...');
264
- try {
265
- const yamlConfig = readYamlConfig();
266
- const result = await mcpServerHandler.syncWithServer(context.apiKey, context.agentId, yamlConfig);
267
- if (result.yamlUpdated) {
268
- writeSuccess('āœ… MCP servers synced from server');
269
- }
270
- else {
271
- writeSuccess('āœ… MCP servers already in sync');
272
- }
273
- }
274
- catch (error) {
275
- console.error(`āŒ Failed to sync MCP servers: ${error.message}`);
276
- }
277
- }
278
- if (pullableSource.length > 0) {
279
- if (primitiveDrift.backupAvailable) {
280
- const expectedNames = pullableSource.map((i) => i.name);
281
- const restoreSuffix = force ? ' (--force: skipping conflict check)' : '';
282
- writeProgress(`šŸ“„ Restoring project files from backup${restoreSuffix}...`);
283
- const result = await restoreFromBackupForSync(context.apiKey, context.agentId, expectedNames, undefined, manifest ?? undefined);
284
- unresolvedCount += reportRestoreResult(result, pullableSource, { verbose: true });
285
- }
286
- else {
287
- // No backup to restore from: every drifted source primitive is unresolved.
288
- // Without this, `--pull` would exit 0 even though nothing was actually synced.
289
- writeInfo('āš ļø Primitive drift detected but no backup available.');
290
- writeInfo(' Run "lua push backup" first to enable pulling primitives from server.');
291
- unresolvedCount += pullableSource.length;
292
- }
293
- }
294
- }
295
- if (drift.name?.serverName) {
296
- writeProgress('šŸ“ Syncing name from server...');
297
- if (agentHandler.pullName(drift.name.serverName)) {
298
- writeSuccess('āœ… Name synced from server');
299
- }
300
- else {
301
- console.error('āŒ Failed to update name in code.');
302
- }
303
- }
304
- if (drift.persona?.serverPersona) {
305
- writeProgress('šŸ“ Syncing persona from server...');
306
- if (agentHandler.pullPersona(drift.persona.serverPersona)) {
307
- writeSuccess('āœ… Persona synced from server');
308
- }
309
- else {
310
- console.error('āŒ Failed to update persona in code.');
311
- }
312
- }
313
- if (drift.model?.serverModel) {
314
- writeProgress('šŸ“ Syncing model from server...');
315
- if (agentHandler.pullModel(drift.model.serverModel)) {
316
- writeSuccess('āœ… Model synced from server');
317
- }
318
- else {
319
- console.error('āŒ Failed to update model in code.');
320
- }
321
- }
322
- // Partial sync = exit non-zero so CI and scripts fail loudly.
323
- if (unresolvedCount > 0) {
324
- writeInfo(`\nāš ļø Sync partially complete — ${unresolvedCount} primitive(s) unresolved. See above.`);
325
- throw new Error(`Sync partially complete: ${unresolvedCount} primitive(s) could not be resolved from backup`);
326
- }
327
- writeSuccess('\nāœ… Sync complete.');
328
- writeHintBlock({
329
- headline: 'Local config updated from server. Verify before pushing:',
330
- lines: [
331
- { label: 'Test it first:', command: 'lua chat -e sandbox -m "test"' },
332
- { label: 'When ready to publish:', command: 'lua push all --force' },
333
- ],
334
- when: 'success',
335
- });
336
- return { pullConflictCount };
337
- }
338
- /**
339
- * Print the outcome of `restoreFromBackupForSync` and return the number of
340
- * drifted primitives the backup couldn't resolve. `verbose` adds the remediation
341
- * hint shown in non-interactive (--pull) mode.
342
- */
343
- function reportRestoreResult(result, pullableSource, options) {
344
- if (!result.success) {
345
- console.error(`āŒ Failed to restore from backup: ${result.error}`);
346
- // A complete restore failure means NO primitives were resolved.
347
- // `restoreFromBackupForSync` populates `primitivesUnresolved` with the full
348
- // expected list on any error path, so this count is correct.
349
- return result.primitivesUnresolved.length;
350
- }
351
- if (result.filesWritten > 0) {
352
- writeSuccess(`āœ… Restored ${result.filesWritten} file(s) from backup (${result.filesUnchanged} unchanged)`);
353
- }
354
- else {
355
- writeInfo(`ā„¹ļø Backup matched local disk — 0 files written${options.verbose ? ` (${result.filesUnchanged} already up-to-date)` : ''}`);
356
- }
357
- if (result.primitivesUnresolved.length === 0)
358
- return 0;
359
- console.log();
360
- writeInfo(options.verbose
361
- ? 'āš ļø The following primitives drifted but are NOT in the backup:'
362
- : 'āš ļø Primitives not in backup (source unavailable):');
363
- for (const name of result.primitivesUnresolved) {
364
- const item = pullableSource.find((i) => i.name === name);
365
- const label = item ? `${item.type}/${name}` : name;
366
- writeInfo(` - ${label}`);
367
- }
368
- if (options.verbose) {
369
- writeInfo(' The backup does not contain source for these primitives.');
370
- writeInfo(' Ask whoever made the changes to run `lua push all --force`,');
371
- writeInfo(' or run `lua <primitive> delete <name>` to remove them from the server.');
372
- if (result.backupAgeDays !== null && result.backupAgeDays >= 1) {
373
- writeInfo(` (Backup is ${result.backupAgeDays} day(s) old — may be stale.)`);
374
- }
375
- }
376
- return result.primitivesUnresolved.length;
377
- }
378
- /**
379
- * Push mode: Push local changes to server without prompting.
380
- */
381
- async function executePushMode(context, drift, primitiveDrift) {
382
- console.log('\nāš ļø Drift detected. Pushing local changes to server...\n');
383
- let syncFullySucceeded = true;
384
- try {
385
- if (drift.persona) {
386
- writeProgress('šŸ“¤ Pushing persona to server...');
387
- const result = await agentHandler.pushPersona(context, drift.persona.localPersona);
388
- if (result.success) {
389
- writeSuccess(`āœ… Persona version ${result.version} created on server`);
390
- }
391
- else {
392
- console.error('āŒ Failed to push persona');
393
- syncFullySucceeded = false;
394
- }
395
- }
396
- if (drift.name) {
397
- writeProgress('šŸ“¤ Pushing name to server...');
398
- if (await agentHandler.pushName(context, drift.name.localName)) {
399
- writeSuccess(`āœ… Agent name updated to "${drift.name.localName}"`);
400
- }
401
- else {
402
- console.error('āŒ Failed to update name');
403
- syncFullySucceeded = false;
404
- }
405
- }
406
- if (drift.model) {
407
- writeProgress('šŸ“¤ Pushing model to server...');
408
- if (await agentHandler.pushModel(context, drift.model.localModel)) {
409
- writeSuccess(`āœ… Agent model updated to "${drift.model.localModel}"`);
410
- }
411
- else {
412
- console.error('āŒ Failed to update model');
413
- syncFullySucceeded = false;
414
- }
415
- }
416
- if (drift.governance) {
417
- writeProgress('šŸ“¤ Pushing governance config to server...');
418
- if (await agentHandler.pushGovernance(context, drift.governance.localGovernance)) {
419
- writeSuccess('āœ… Governance config pushed to server');
420
- }
421
- else {
422
- console.error('āŒ Failed to push governance config');
423
- syncFullySucceeded = false;
424
- }
425
- }
426
- }
427
- catch (error) {
428
- console.error('āŒ Failed to push to server:', error.message);
429
- syncFullySucceeded = false;
430
- }
431
- // Handle primitive drift — show which primitives need pushing
432
- if (primitiveDrift.hasDrift) {
433
- const pushableItems = primitiveDrift.items.filter((item) => item.status !== 'missing-locally');
434
- if (pushableItems.length > 0) {
435
- console.log('\nāš ļø Primitive drift detected:');
436
- for (const item of pushableItems) {
437
- const localV = item.localVersion ? `v${item.localVersion}` : '(none)';
438
- const serverV = item.serverVersion ? `v${item.serverVersion}` : '(none)';
439
- console.log(` ${item.type}: ${item.name} (local ${localV}, server ${serverV})`);
440
- }
441
- console.log('\nšŸ’” To push these primitives, run: lua push all --force');
442
- }
443
- const missingLocally = primitiveDrift.items.filter((item) => item.status === 'missing-locally');
444
- if (missingLocally.length > 0) {
445
- console.log('\nāš ļø Primitives on server but not in local config:');
446
- for (const item of missingLocally) {
447
- const serverV = item.serverVersion ? `v${item.serverVersion}` : '(none)';
448
- console.log(` ${item.type}: ${item.name} (server ${serverV})`);
449
- }
450
- console.log(' These cannot be pushed. Use "lua sync --accept" to pull them.');
451
- }
452
- }
453
- writeSuccess('\n' + `${syncFullySucceeded ? 'āœ…' : 'āš ļø '} Sync complete${syncFullySucceeded ? '.' : ' (with errors).'}`);
454
- writeHintBlock({
455
- headline: syncFullySucceeded
456
- ? 'Server updated. Verify the changes:'
457
- : 'Sync completed with errors. Verify what succeeded:',
458
- lines: [
459
- { label: 'Sandbox test:', command: 'lua chat -e sandbox -m "test"' },
460
- { label: 'Production test:', command: 'lua chat -e production -m "test"' },
461
- { label: 'Inspect logs:', command: buildLogsCommand({ limit: 10 }) },
462
- ],
463
- when: syncFullySucceeded ? 'success' : 'partial',
464
- });
465
- }
466
- // ─────────────────────────────────────────────────────────────────────────────
467
- // Interactive Mode
468
- // ─────────────────────────────────────────────────────────────────────────────
469
- /**
470
- * Interactive mode: Prompt for resolution of each drifted component.
471
- *
472
- * Primitive drift is handled first so that a "pull from backup" choice
473
- * doesn't overwrite the persona/name/model the user just pulled — same
474
- * write-ordering rule as `executeAcceptMode`.
475
- */
476
- async function executeInteractiveMode(context, drift, primitiveDrift) {
477
- if (primitiveDrift.hasDrift) {
478
- await handlePrimitiveDriftInteractive(context, primitiveDrift);
479
- }
480
- if (drift.name) {
481
- await handleNameDriftInteractive(context, drift.name);
482
- }
483
- if (drift.persona) {
484
- await handlePersonaDriftInteractive(context, drift.persona);
485
- }
486
- if (drift.model) {
487
- await handleModelDriftInteractive(context, drift.model);
488
- }
489
- if (primitiveDrift.hasDrift) {
490
- await handlePrimitiveDriftInteractive(context, primitiveDrift);
491
- }
492
- if (drift.governance) {
493
- await handleGovernanceDriftInteractive(context, drift.governance);
494
- }
495
- writeSuccess('\nāœ… Sync complete.');
496
- writeHintBlock({
497
- headline: 'Sync complete. Verify the changes:',
498
- lines: [
499
- { label: 'Sandbox test:', command: 'lua chat -e sandbox -m "test"' },
500
- { label: 'Production test:', command: 'lua chat -e production -m "test"' },
501
- { label: 'Inspect logs:', command: buildLogsCommand({ limit: 10 }) },
502
- ],
503
- when: 'success',
504
- });
505
- }
506
- /**
507
- * Handle name drift interactively.
508
- */
509
- async function handleNameDriftInteractive(context, drift) {
510
- showNameDiff(drift.serverName, drift.localName);
511
- const answer = await safePrompt([
512
- {
513
- type: 'list',
514
- name: 'action',
515
- message: 'What would you like to do with the name?',
516
- choices: [
517
- { name: 'šŸ“¤ Push local to server', value: 'push' },
518
- { name: 'šŸ“„ Pull server to local', value: 'pull' },
519
- { name: 'ā­ļø Skip', value: 'skip' },
520
- ],
521
- },
522
- ]);
523
- if (!answer || answer.action === 'skip') {
524
- writeInfo('Skipped name sync.');
525
- return;
526
- }
527
- if (answer.action === 'push') {
528
- writeProgress('šŸ“¤ Pushing name to server...');
529
- try {
530
- if (await agentHandler.pushName(context, drift.localName)) {
531
- writeSuccess(`āœ… Agent name updated to "${drift.localName}"`);
532
- }
533
- else {
534
- console.error('āŒ Failed to update name');
535
- }
536
- }
537
- catch (error) {
538
- console.error('āŒ Failed to update name:', error.message);
539
- }
540
- }
541
- else if (answer.action === 'pull' && drift.serverName) {
542
- writeProgress('šŸ“„ Updating name in code...');
543
- if (agentHandler.pullName(drift.serverName)) {
544
- writeSuccess('āœ… Name updated in src/index.ts');
545
- }
546
- else {
547
- console.error('āŒ Failed to update name in code.');
548
- }
549
- }
550
- }
551
- /**
552
- * Handle persona drift interactively.
553
- */
554
- async function handlePersonaDriftInteractive(context, drift) {
555
- showPersonaDiff(drift.serverPersona, drift.localPersona);
556
- const answer = await safePrompt([
557
- {
558
- type: 'list',
559
- name: 'action',
560
- message: 'What would you like to do with persona?',
561
- choices: [
562
- { name: 'šŸ“¤ Push local to server', value: 'push' },
563
- { name: 'šŸ“„ Pull server to local', value: 'pull' },
564
- { name: 'ā­ļø Skip', value: 'skip' },
565
- ],
566
- },
567
- ]);
568
- if (!answer || answer.action === 'skip') {
569
- writeInfo('Skipped persona sync.');
570
- return;
571
- }
572
- if (answer.action === 'push') {
573
- writeProgress('šŸ“¤ Pushing persona to server...');
574
- try {
575
- const result = await agentHandler.pushPersona(context, drift.localPersona);
576
- if (result.success) {
577
- writeSuccess(`āœ… Persona version ${result.version} created on server`);
578
- }
579
- else {
580
- console.error('āŒ Failed to push persona');
581
- }
582
- }
583
- catch (error) {
584
- console.error('āŒ Failed to push persona:', error.message);
585
- }
586
- }
587
- else if (answer.action === 'pull' && drift.serverPersona) {
588
- writeProgress('šŸ“„ Updating persona in code...');
589
- if (agentHandler.pullPersona(drift.serverPersona)) {
590
- writeSuccess('āœ… Persona updated in src/index.ts');
591
- }
592
- else {
593
- console.error('āŒ Failed to update persona in code.');
594
- }
595
- }
596
- }
597
- /**
598
- * Handle model drift interactively.
599
- */
600
- async function handleModelDriftInteractive(context, drift) {
601
- showModelDiff(drift.serverModel, drift.localModel);
602
- const answer = await safePrompt([
603
- {
604
- type: 'list',
605
- name: 'action',
606
- message: 'What would you like to do with the model?',
607
- choices: [
608
- { name: 'šŸ“¤ Push local to server', value: 'push' },
609
- { name: 'šŸ“„ Pull server to local', value: 'pull' },
610
- { name: 'ā­ļø Skip', value: 'skip' },
611
- ],
612
- },
613
- ]);
614
- if (!answer || answer.action === 'skip') {
615
- writeInfo('Skipped model sync.');
616
- return;
617
- }
618
- if (answer.action === 'push') {
619
- writeProgress('šŸ“¤ Pushing model to server...');
620
- try {
621
- if (await agentHandler.pushModel(context, drift.localModel)) {
622
- writeSuccess(`āœ… Agent model updated to "${drift.localModel}"`);
623
- }
624
- else {
625
- console.error('āŒ Failed to update model');
626
- }
627
- }
628
- catch (error) {
629
- console.error('āŒ Failed to update model:', error.message);
630
- }
631
- }
632
- else if (answer.action === 'pull' && drift.serverModel) {
633
- writeProgress('šŸ“„ Updating model in code...');
634
- if (agentHandler.pullModel(drift.serverModel)) {
635
- writeSuccess('āœ… Model updated in src/index.ts');
636
- }
637
- else {
638
- console.error('āŒ Failed to update model in code.');
639
- }
640
- }
641
- }
642
- /**
643
- * Handle primitive drift interactively.
644
- * Displays all drifted primitives, then prompts for each one.
645
- * If the user chooses "pull" for any primitive, the entire project
646
- * is restored from backup (once).
647
- */
648
- async function handlePrimitiveDriftInteractive(context, primitiveDrift) {
649
- showPrimitiveDrift(primitiveDrift.items, primitiveDrift.backupAvailable);
650
- let hasRestoredFromBackup = false;
651
- let hasSyncedMcp = false;
652
- for (const item of primitiveDrift.items) {
653
- const choices = [];
654
- const isMcp = item.type === 'mcpServer';
655
- if (item.status !== 'missing-locally') {
656
- choices.push({ name: 'šŸ“¤ Push local to server', value: 'push' });
657
- }
658
- if (item.status !== 'missing-on-server') {
659
- if (isMcp) {
660
- // MCP servers pull live from the server, not from backup.
661
- choices.push({ name: 'šŸ“„ Pull from server', value: 'pull-mcp' });
662
- }
663
- else if (primitiveDrift.backupAvailable) {
664
- choices.push({ name: 'šŸ“„ Pull from backup', value: 'pull' });
665
- }
666
- else {
667
- choices.push({ name: 'šŸ“„ Pull from backup (unavailable)', value: 'pull-unavailable' });
668
- }
669
- }
670
- choices.push({ name: 'ā­ļø Skip', value: 'skip' });
671
- const answer = await safePrompt([
672
- {
673
- type: 'list',
674
- name: 'action',
675
- message: `${item.type}: ${item.name} — What would you like to do?`,
676
- choices,
677
- },
678
- ]);
679
- if (!answer || answer.action === 'skip') {
680
- writeInfo(`Skipped ${item.type}: ${item.name}`);
681
- continue;
682
- }
683
- if (answer.action === 'push') {
684
- // The internal drift type 'mcpServer' maps to CLI arg 'mcp' (see validTypes in push.ts).
685
- const pushArg = item.type === 'mcpServer' ? 'mcp' : item.type;
686
- writeInfo(`šŸ’” To push this ${item.type}, run: lua push ${pushArg} --name "${item.name}"`);
687
- }
688
- else if (answer.action === 'pull-mcp') {
689
- // mcpServerHandler.syncWithServer does a bulk sync of all MCP servers,
690
- // so only call it once per session.
691
- if (hasSyncedMcp) {
692
- writeInfo(`āœ… Already synced MCP servers (includes ${item.name})`);
693
- }
694
- else {
695
- writeProgress('šŸ“„ Syncing MCP servers from server...');
696
- try {
697
- const yamlConfig = readYamlConfig();
698
- const result = await mcpServerHandler.syncWithServer(context.apiKey, context.agentId, yamlConfig);
699
- writeSuccess(result.yamlUpdated ? 'āœ… MCP servers synced from server' : 'āœ… MCP servers already in sync');
700
- hasSyncedMcp = true;
701
- }
702
- catch (error) {
703
- console.error(`āŒ Failed to sync MCP servers: ${error.message}`);
704
- }
705
- }
706
- }
707
- else if (answer.action === 'pull') {
708
- if (hasRestoredFromBackup) {
709
- writeInfo(`āœ… Already restored from backup (includes ${item.name})`);
710
- }
711
- else {
712
- const pullableSource = primitiveDrift.items.filter((i) => i.type !== 'mcpServer' && i.status !== 'missing-on-server');
713
- writeProgress('šŸ“„ Restoring project files from backup...');
714
- const result = await restoreFromBackupForSync(context.apiKey, context.agentId, pullableSource.map((i) => i.name));
715
- if (result.success) {
716
- hasRestoredFromBackup = true;
717
- reportRestoreResult(result, pullableSource, { verbose: false });
718
- }
719
- else {
720
- console.error(`āŒ Failed to restore from backup: ${result.error}`);
721
- }
722
- }
723
- }
724
- else if (answer.action === 'pull-unavailable') {
725
- writeInfo('āš ļø No backup available. Run "lua push backup" first to enable pulling from server.');
726
- }
727
- }
728
- }
729
- /**
730
- * Handle governance drift interactively.
731
- * Governance is push-only — pull is not supported since it's a structured config
732
- * object defined in code, not a simple string we can write back.
733
- */
734
- async function handleGovernanceDriftInteractive(context, drift) {
735
- showGovernanceDiff(drift.serverGovernance, drift.localGovernance);
736
- const answer = await safePrompt([
737
- {
738
- type: 'list',
739
- name: 'action',
740
- message: 'What would you like to do with governance config?',
741
- choices: [
742
- { name: 'šŸ“¤ Push local to server', value: 'push' },
743
- { name: 'ā­ļø Skip', value: 'skip' },
744
- ],
745
- },
746
- ]);
747
- if (!answer || answer.action === 'skip') {
748
- writeInfo('Skipped governance sync.');
749
- return;
750
- }
751
- if (answer.action === 'push') {
752
- writeProgress('šŸ“¤ Pushing governance config to server...');
753
- try {
754
- if (await agentHandler.pushGovernance(context, drift.localGovernance)) {
755
- writeSuccess('āœ… Governance config pushed to server');
756
- }
757
- else {
758
- console.error('āŒ Failed to push governance config');
759
- }
760
- }
761
- catch (error) {
762
- console.error('āŒ Failed to push governance config:', error.message);
763
- }
764
- }
765
- }
766
- // ─────────────────────────────────────────────────────────────────────────────
767
- // Compile Flow Integration
768
- // ─────────────────────────────────────────────────────────────────────────────
769
- /**
770
- * Run sync check during compile flow.
771
- * By default, warns about drift but continues compilation (non-blocking).
772
- */
773
- export async function runSyncCheck(apiKey, agentId) {
774
- const drift = await agentHandler.checkDrift(apiKey, agentId);
775
- if (!agentHandler.hasDrift(drift)) {
776
- return true;
777
- }
778
- // Warn about drift but continue compilation
779
- console.log('\nāš ļø Drift detected between local code and server.');
780
- if (drift.name) {
781
- writeInfo(` Name: local "${drift.name.localName}" ≠ server "${drift.name.serverName || '(empty)'}"`);
782
- }
783
- if (drift.persona) {
784
- writeInfo(' Persona: local and server versions differ');
785
- }
786
- if (drift.model) {
787
- writeInfo(` Model: local "${drift.model.localModel}" ≠ server "${drift.model.serverModel || '(empty)'}"`);
788
- }
789
- if (drift.governance) {
790
- const localMode = drift.governance.localGovernance?.mode || '(none)';
791
- const serverMode = drift.governance.serverGovernance?.mode || '(none)';
792
- writeInfo(` Governance: local "${localMode}" ≠ server "${serverMode}"`);
793
- }
794
- console.log();
795
- writeInfo('šŸ’” To resolve drift:');
796
- writeInfo(' lua sync --push Push local changes to server');
797
- writeInfo(' lua sync --accept Pull server changes to local');
798
- writeInfo(' lua sync Interactive resolution');
799
- console.log();
800
- return true;
801
- }
802
- //# sourceMappingURL=sync.js.map