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,2105 +0,0 @@
1
- /**
2
- * Marketplace Command
3
- * A command to interact with the Lua Marketplace.
4
- */
5
- import { withErrorHandling, writeProgress, writeSuccess, writeInfo, writeHintBlock } from '../utils/cli.js';
6
- import { safePrompt } from '../utils/prompt-handler.js';
7
- import { MarketplaceApiService } from '../api/marketplace.api.service.js';
8
- import { initializeCommand } from '../utils/command-utils.js';
9
- import { BASE_URLS } from '../config/constants.js';
10
- import SkillApi from '../api/skills.api.service.js';
11
- import DeveloperApi from '../api/developer.api.service.js';
12
- import { loadSandboxEnvVariables } from '../utils/env-loader.utils.js';
13
- import inquirer from 'inquirer';
14
- import { compareVersions } from '../utils/semver.js';
15
- import { trackEvent } from '../services/analytics.js';
16
- import { validateOrSuggest } from '../utils/aliases.js';
17
- // Valid creator actions
18
- const CREATOR_ACTIONS = ['list', 'publish', 'update', 'unlist', 'unpublish', 'view'];
19
- // Valid installer actions
20
- const INSTALLER_ACTIONS = ['search', 'view', 'install', 'update', 'uninstall', 'installed'];
21
- /**
22
- * Shows marketplace usage help
23
- */
24
- function showMarketplaceUsage() {
25
- console.log('\nUsage:');
26
- console.log(' lua marketplace Interactive mode');
27
- console.log(' lua marketplace create [action] [options] Creator actions');
28
- console.log(' lua marketplace install [action] [options] Installer actions');
29
- console.log('\nCreator Actions:');
30
- console.log(' list --skill-name <name> --display-name <name>');
31
- console.log(' publish --marketplace-id <id> --version-id <id> [--changelog <text>]');
32
- console.log(' update --marketplace-id <id> --display-name <name>');
33
- console.log(' unlist --marketplace-id <id> [--force]');
34
- console.log(' unpublish --marketplace-id <id> --version-id <id> [--force]');
35
- console.log(' view');
36
- console.log('\nInstaller Actions:');
37
- console.log(' search [--query <text>] [--page <n>] [--limit <n>] [--json]');
38
- console.log(' view --marketplace-id <id> [--json]');
39
- console.log(' install --marketplace-id <id> --version-id <id> [--env-vars <k=v,...>] [--force]');
40
- console.log(' update --skill-name <name> [--version-id <id>] [--env-vars <k=v,...>]');
41
- console.log(' uninstall --skill-name <name> [--force]');
42
- console.log(' installed [--json]');
43
- }
44
- /**
45
- * Main marketplace command - interactive menu with non-interactive support.
46
- *
47
- * Features:
48
- * - Role selection (Creator or Installer)
49
- * - Creator: List, publish, update, unlist skills, manage versions
50
- * - Installer: Browse, search, install, and manage marketplace skills
51
- * - Non-interactive mode via action + flags
52
- *
53
- * @param role - Optional role argument ('create', 'creator', 'install', or 'installer')
54
- * @param action - Optional action for non-interactive mode
55
- * @param options - Options for non-interactive mode
56
- * @returns Promise that resolves when command completes.
57
- */
58
- export async function marketplaceCommand(role, action, options) {
59
- return withErrorHandling(async () => {
60
- // Initialize command (validates config + auth)
61
- const { config, apiKey } = await initializeCommand();
62
- const marketplaceApi = new MarketplaceApiService(apiKey);
63
- let selectedRole = null;
64
- // Step 3: Check if role was provided as argument
65
- if (role) {
66
- const normalizedRole = validateOrSuggest('marketplace.role', role);
67
- selectedRole = normalizedRole === 'create' ? 'creator' : 'installer';
68
- }
69
- // Step 4: If action is provided, run non-interactive mode
70
- if (selectedRole && action) {
71
- if (selectedRole === 'creator') {
72
- const normalizedAction = validateOrSuggest('marketplace.action.create', action);
73
- await executeCreatorActionNonInteractive(marketplaceApi, config, apiKey, normalizedAction, options || {});
74
- }
75
- else {
76
- const normalizedAction = validateOrSuggest('marketplace.action.install', action);
77
- await executeInstallerActionNonInteractive(marketplaceApi, config, apiKey, normalizedAction, options || {});
78
- }
79
- return;
80
- }
81
- // If role was provided as argument (but no action), go directly to that flow
82
- if (selectedRole) {
83
- if (selectedRole === 'creator') {
84
- await handleCreatorActions(marketplaceApi, config, apiKey);
85
- }
86
- else {
87
- await handleInstallerActions(marketplaceApi, config, apiKey);
88
- }
89
- return;
90
- }
91
- // Otherwise, show interactive selection
92
- let exit = false;
93
- while (!exit) {
94
- const roleAnswer = await safePrompt([
95
- {
96
- type: 'list',
97
- name: 'role',
98
- message: 'What would you like to do?',
99
- choices: [
100
- {
101
- name: 'As a Creator (Publish & Manage your skills)',
102
- value: 'creator',
103
- },
104
- {
105
- name: 'As an Installer (Find & Install skills)',
106
- value: 'installer',
107
- },
108
- { name: 'Exit', value: 'exit' },
109
- ],
110
- },
111
- ]);
112
- if (!roleAnswer || roleAnswer.role === 'exit') {
113
- exit = true;
114
- console.log('\nšŸ‘‹ Goodbye!\n');
115
- continue;
116
- }
117
- if (roleAnswer.role === 'creator') {
118
- await handleCreatorActions(marketplaceApi, config, apiKey);
119
- }
120
- else if (roleAnswer.role === 'installer') {
121
- await handleInstallerActions(marketplaceApi, config, apiKey);
122
- }
123
- }
124
- trackEvent('cli_marketplace_action', {
125
- role: role || 'interactive',
126
- action: action || null,
127
- non_interactive: !!(selectedRole && action),
128
- });
129
- }, 'marketplace');
130
- }
131
- /**
132
- * Execute creator action in non-interactive mode
133
- */
134
- async function executeCreatorActionNonInteractive(marketplaceApi, config, apiKey, action, options) {
135
- switch (action) {
136
- case 'list':
137
- await listSkillNonInteractive(marketplaceApi, config, apiKey, options);
138
- break;
139
- case 'publish':
140
- await publishVersionNonInteractive(marketplaceApi, config, apiKey, options);
141
- break;
142
- case 'update':
143
- await updateMetadataNonInteractive(marketplaceApi, options);
144
- break;
145
- case 'unlist':
146
- await unlistSkillNonInteractive(marketplaceApi, options);
147
- break;
148
- case 'unpublish':
149
- await unpublishVersionNonInteractive(marketplaceApi, options);
150
- break;
151
- case 'view':
152
- await viewMyListedSkillsNonInteractive(marketplaceApi, options);
153
- break;
154
- }
155
- }
156
- /**
157
- * Execute installer action in non-interactive mode
158
- */
159
- async function executeInstallerActionNonInteractive(marketplaceApi, config, apiKey, action, options) {
160
- switch (action) {
161
- case 'search':
162
- await searchSkillsNonInteractive(marketplaceApi, options);
163
- break;
164
- case 'view':
165
- await viewSkillNonInteractive(marketplaceApi, options);
166
- break;
167
- case 'install':
168
- await installSkillNonInteractive(marketplaceApi, config, options);
169
- break;
170
- case 'update':
171
- await updateInstalledSkillNonInteractive(marketplaceApi, config, apiKey, options);
172
- break;
173
- case 'uninstall':
174
- await uninstallSkillNonInteractive(marketplaceApi, config, options);
175
- break;
176
- case 'installed':
177
- await listInstalledSkillsNonInteractive(marketplaceApi, config, options);
178
- break;
179
- }
180
- }
181
- // ============================================================================
182
- // NON-INTERACTIVE CREATOR ACTIONS
183
- // ============================================================================
184
- /**
185
- * Non-interactive: List a skill on the marketplace
186
- */
187
- async function listSkillNonInteractive(marketplaceApi, config, apiKey, options) {
188
- const { skillName, displayName } = options;
189
- if (!skillName || !displayName) {
190
- console.error('āŒ Missing required options');
191
- console.log('\nUsage: lua marketplace create list --skill-name <name> --display-name <name>');
192
- throw new Error('Missing required options');
193
- }
194
- const agentId = config.agent?.agentId;
195
- if (!agentId) {
196
- console.error('āŒ Agent ID not found in configuration.');
197
- throw new Error('Agent ID not found in configuration.');
198
- }
199
- // Verify skill exists
200
- const skillApi = new SkillApi(BASE_URLS.API, apiKey, agentId);
201
- writeProgress('šŸ”„ Verifying skill...');
202
- const agentSkillsResponse = await skillApi.getSkills();
203
- if (!agentSkillsResponse.success || !agentSkillsResponse.data) {
204
- console.error(`āŒ Failed to fetch agent skills: ${agentSkillsResponse.message}`);
205
- throw new Error('Failed to fetch agent skills: ${agentSkillsResponse.message}');
206
- }
207
- const skill = agentSkillsResponse.data.skills?.find((s) => s.name === skillName);
208
- if (!skill) {
209
- console.error(`āŒ Skill not found: ${skillName}`);
210
- writeInfo('\nAvailable skills:');
211
- agentSkillsResponse.data.skills?.forEach((s) => {
212
- writeInfo(` - ${s.name}`);
213
- });
214
- throw new Error('Skill not found: ${skillName}');
215
- }
216
- // Check if already listed
217
- const creatorSkills = await marketplaceApi.getCreatorSkills();
218
- const existingSkill = creatorSkills?.find((s) => s.sourceSkillId === skill.id);
219
- if (existingSkill?.listed) {
220
- console.error(`āŒ Skill "${skill.name}" is already listed as "${existingSkill.displayName}".`);
221
- throw new Error('Skill');
222
- }
223
- // List the skill
224
- writeProgress('šŸ”„ Listing skill on marketplace...');
225
- const marketplaceSkill = await marketplaceApi.listSkill({
226
- skillId: skill.id,
227
- displayName: displayName,
228
- });
229
- writeSuccess(`āœ… Skill "${marketplaceSkill.displayName}" listed successfully!`);
230
- writeInfo(`Marketplace Skill ID: ${marketplaceSkill.id}`);
231
- writeInfo('šŸ’” You can now publish a version to make it installable.');
232
- }
233
- /**
234
- * Non-interactive: Publish a version to the marketplace
235
- */
236
- async function publishVersionNonInteractive(marketplaceApi, config, apiKey, options) {
237
- const { marketplaceId, versionId, changelog, envVarsJson } = options;
238
- if (!marketplaceId || !versionId) {
239
- console.error('āŒ Missing required options');
240
- console.log('\nUsage: lua marketplace create publish --marketplace-id <id> --version-id <id> [--changelog <text>]');
241
- throw new Error('Missing required options');
242
- }
243
- // Parse env vars if provided
244
- let envVars;
245
- if (envVarsJson) {
246
- try {
247
- envVars = JSON.parse(envVarsJson);
248
- }
249
- catch (e) {
250
- console.error('āŒ Invalid --env-vars-json: must be valid JSON');
251
- throw new Error('Invalid --env-vars-json: must be valid JSON');
252
- }
253
- }
254
- writeProgress('šŸ”„ Publishing version...');
255
- const payload = {
256
- versionId,
257
- changelog: changelog || undefined,
258
- envVars: envVars && Object.keys(envVars).length > 0 ? envVars : undefined,
259
- };
260
- const publishedVersion = await marketplaceApi.publishVersion(marketplaceId, payload);
261
- writeSuccess(`āœ… Version ${publishedVersion.version} published successfully!`);
262
- writeInfo('šŸ’” You will be notified once the review is complete.');
263
- }
264
- /**
265
- * Non-interactive: Update skill metadata
266
- */
267
- async function updateMetadataNonInteractive(marketplaceApi, options) {
268
- const { marketplaceId, displayName } = options;
269
- if (!marketplaceId) {
270
- console.error('āŒ Missing required option: --marketplace-id');
271
- console.log('\nUsage: lua marketplace create update --marketplace-id <id> --display-name <name>');
272
- throw new Error('Missing required option: --marketplace-id');
273
- }
274
- if (!displayName) {
275
- console.error('āŒ No update specified. Provide --display-name to update.');
276
- throw new Error('No update specified. Provide --display-name to update.');
277
- }
278
- writeProgress('šŸ”„ Updating skill metadata...');
279
- await marketplaceApi.updateSkill(marketplaceId, { displayName });
280
- writeSuccess(`āœ… Display name updated to "${displayName}"!`);
281
- }
282
- /**
283
- * Non-interactive: Unlist a skill from the marketplace
284
- */
285
- async function unlistSkillNonInteractive(marketplaceApi, options) {
286
- const { marketplaceId, force } = options;
287
- if (!marketplaceId) {
288
- console.error('āŒ Missing required option: --marketplace-id');
289
- console.log('\nUsage: lua marketplace create unlist --marketplace-id <id> [--force]');
290
- throw new Error('Missing required option: --marketplace-id');
291
- }
292
- if (!force) {
293
- console.error('āŒ This action requires --force to confirm');
294
- console.log('\nUsage: lua marketplace create unlist --marketplace-id <id> --force');
295
- throw new Error('This action requires --force to confirm');
296
- }
297
- writeProgress('šŸ”„ Unlisting skill...');
298
- await marketplaceApi.unlistSkill(marketplaceId);
299
- writeSuccess('āœ… Skill unlisted from marketplace.');
300
- writeInfo('šŸ’” You can re-list it anytime using the list action.');
301
- }
302
- /**
303
- * Non-interactive: Unpublish a version
304
- */
305
- async function unpublishVersionNonInteractive(marketplaceApi, options) {
306
- const { marketplaceId, versionId, force } = options;
307
- if (!marketplaceId || !versionId) {
308
- console.error('āŒ Missing required options');
309
- console.log('\nUsage: lua marketplace create unpublish --marketplace-id <id> --version-id <id> [--force]');
310
- throw new Error('Missing required options');
311
- }
312
- if (!force) {
313
- console.error('āŒ This action requires --force to confirm');
314
- throw new Error('This action requires --force to confirm');
315
- }
316
- writeProgress('šŸ”„ Unpublishing version...');
317
- await marketplaceApi.unpublishVersion(marketplaceId, versionId);
318
- writeSuccess('āœ… Version unpublished successfully.');
319
- writeInfo('šŸ’” Users can no longer install this version.');
320
- }
321
- /**
322
- * Non-interactive: View my listed skills
323
- */
324
- async function viewMyListedSkillsNonInteractive(marketplaceApi, options) {
325
- writeProgress('šŸ”„ Loading your marketplace skills...');
326
- const skills = await marketplaceApi.getCreatorSkills();
327
- if (!skills || skills.length === 0) {
328
- writeInfo("šŸ“¦ You haven't listed any skills on the marketplace yet.");
329
- return;
330
- }
331
- if (options.json) {
332
- console.log(JSON.stringify(skills, null, 2));
333
- return;
334
- }
335
- console.log(`\nšŸ“Š You have ${skills.length} skill(s) on the marketplace:\n`);
336
- for (const skill of skills) {
337
- const statusIcon = skill.listed ? 'āœ…' : 'āŒ';
338
- const statusText = skill.listed ? 'Listed' : 'Unlisted';
339
- console.log(`${statusIcon} ${skill.displayName} (${skill.name})`);
340
- console.log(` ID: ${skill.id}`);
341
- console.log(` Status: ${statusText}`);
342
- if (skill.versions && skill.versions.length > 0) {
343
- const publishedVersions = skill.versions.filter((v) => v.published);
344
- console.log(` Versions: ${publishedVersions.length} published / ${skill.versions.length} total`);
345
- }
346
- console.log('');
347
- }
348
- }
349
- // ============================================================================
350
- // NON-INTERACTIVE INSTALLER ACTIONS
351
- // ============================================================================
352
- /**
353
- * Non-interactive: Search marketplace skills
354
- */
355
- async function searchSkillsNonInteractive(marketplaceApi, options) {
356
- const page = options.page ? parseInt(options.page, 10) : 1;
357
- const limit = options.limit ? parseInt(options.limit, 10) : 10;
358
- writeProgress(options.query ? `šŸ” Searching for "${options.query}"...` : 'šŸ” Loading marketplace skills...');
359
- const filters = { page, limit, publishedVersionsOnly: true };
360
- if (options.query)
361
- filters.search = options.query;
362
- const results = await marketplaceApi.searchSkills(filters);
363
- const skills = results?.data || [];
364
- const pagination = results?.pagination;
365
- if (options.json) {
366
- console.log(JSON.stringify(results, null, 2));
367
- return;
368
- }
369
- if (skills.length === 0) {
370
- writeInfo(options.query ? `šŸ“¦ No skills found matching "${options.query}".` : 'šŸ“¦ No skills available on the marketplace.');
371
- return;
372
- }
373
- const totalCount = pagination?.totalCount || skills.length;
374
- const totalPages = pagination?.totalPages || 1;
375
- console.log(`\nšŸ“Š Found ${totalCount} skill(s) (Page ${page}/${totalPages}):\n`);
376
- for (const skill of skills) {
377
- console.log(`šŸ“¦ ${skill.displayName}`);
378
- console.log(` ID: ${skill.id}`);
379
- console.log(` Name: ${skill.name}`);
380
- if (skill.description)
381
- console.log(` Description: ${skill.description}`);
382
- if (typeof skill.installCount !== 'undefined')
383
- console.log(` Installs: ${skill.installCount}`);
384
- console.log('');
385
- }
386
- }
387
- /**
388
- * Non-interactive: View skill details
389
- */
390
- async function viewSkillNonInteractive(marketplaceApi, options) {
391
- const { marketplaceId } = options;
392
- if (!marketplaceId) {
393
- console.error('āŒ Missing required option: --marketplace-id');
394
- console.log('\nUsage: lua marketplace install view --marketplace-id <id>');
395
- throw new Error('Missing required option: --marketplace-id');
396
- }
397
- writeProgress('šŸ”„ Loading skill details...');
398
- const skill = await marketplaceApi.getSkillById(marketplaceId);
399
- if (options.json) {
400
- console.log(JSON.stringify(skill, null, 2));
401
- return;
402
- }
403
- console.log(`\n${'='.repeat(60)}`);
404
- console.log(`šŸ“¦ ${skill.displayName}`);
405
- console.log(`${'='.repeat(60)}\n`);
406
- console.log(`ID: ${skill.id}`);
407
- console.log(`Name: ${skill.name}`);
408
- console.log(`Created: ${new Date(skill.createdAt).toLocaleDateString()}`);
409
- if (skill.description)
410
- console.log(`\nDescription: ${skill.description}`);
411
- if (skill.longDescription)
412
- console.log(`\nDetails:\n${skill.longDescription}`);
413
- if (skill.category)
414
- console.log(`\nCategory: ${skill.category}`);
415
- if (skill.tags?.length)
416
- console.log(`Tags: ${skill.tags.join(', ')}`);
417
- if (typeof skill.installCount !== 'undefined')
418
- console.log(`Installs: ${skill.installCount}`);
419
- if (skill.versions?.length) {
420
- const publishedVersions = skill.versions.filter((v) => v.published);
421
- console.log(`\nVersions: ${publishedVersions.length} published / ${skill.versions.length} total`);
422
- if (publishedVersions.length > 0) {
423
- const latest = publishedVersions.sort((a, b) => compareVersions(b.version, a.version))[0];
424
- console.log(`Latest: v${latest.version} (ID: ${latest.id})`);
425
- }
426
- }
427
- console.log(`\n${'='.repeat(60)}\n`);
428
- }
429
- /**
430
- * Non-interactive: Install a skill
431
- */
432
- async function installSkillNonInteractive(marketplaceApi, config, options) {
433
- const { marketplaceId, versionId, envVars, force } = options;
434
- if (!marketplaceId || !versionId) {
435
- console.error('āŒ Missing required options');
436
- console.log('\nUsage: lua marketplace install install --marketplace-id <id> --version-id <id> [--env-vars <k=v,...>]');
437
- throw new Error('Missing required options');
438
- }
439
- const agentId = config.agent?.agentId;
440
- if (!agentId) {
441
- console.error('āŒ Agent ID not found in configuration.');
442
- throw new Error('Agent ID not found in configuration.');
443
- }
444
- // Parse env vars
445
- const envVarsConfig = {};
446
- if (envVars) {
447
- const pairs = envVars.split(',');
448
- for (const pair of pairs) {
449
- const [key, ...valueParts] = pair.split('=');
450
- if (key && valueParts.length > 0) {
451
- envVarsConfig[key.trim()] = valueParts.join('=').trim();
452
- }
453
- }
454
- }
455
- if (!force) {
456
- writeInfo(`\nšŸ“‹ Installation Summary:`);
457
- writeInfo(` Marketplace ID: ${marketplaceId}`);
458
- writeInfo(` Version ID: ${versionId}`);
459
- writeInfo(` Agent: ${agentId}`);
460
- if (Object.keys(envVarsConfig).length > 0) {
461
- writeInfo(` Env vars: ${Object.keys(envVarsConfig).length} configured`);
462
- }
463
- console.error('\nāŒ Use --force to confirm installation');
464
- throw new Error('Operation failed');
465
- }
466
- writeProgress('šŸ”„ Installing skill...');
467
- await marketplaceApi.installSkill(marketplaceId, agentId, {
468
- versionId,
469
- envVars: Object.keys(envVarsConfig).length > 0 ? envVarsConfig : undefined,
470
- });
471
- writeSuccess('āœ… Skill installed successfully!');
472
- writeInfo(`šŸ’” The skill is now available on agent ${agentId}.`);
473
- writeHintBlock({
474
- headline: 'Skill installed locally. Make it live:',
475
- lines: [
476
- { label: 'Deploy:', command: 'lua push all --force --auto-deploy' },
477
- { label: 'Or stage only:', command: 'lua push all --force' },
478
- ],
479
- when: 'success',
480
- });
481
- }
482
- /**
483
- * Non-interactive: Update an installed skill
484
- */
485
- async function updateInstalledSkillNonInteractive(marketplaceApi, config, apiKey, options) {
486
- const { skillName, versionId, envVars } = options;
487
- if (!skillName) {
488
- console.error('āŒ Missing required option: --skill-name');
489
- console.log('\nUsage: lua marketplace install update --skill-name <name> [--version-id <id>] [--env-vars <k=v,...>]');
490
- throw new Error('Missing required option: --skill-name');
491
- }
492
- const agentId = config.agent?.agentId;
493
- if (!agentId) {
494
- console.error('āŒ Agent ID not found in configuration.');
495
- throw new Error('Agent ID not found in configuration.');
496
- }
497
- // Find the installed skill
498
- writeProgress('šŸ”„ Loading installed skills...');
499
- const installedSkills = await marketplaceApi.getInstalledSkills(agentId);
500
- const installedSkill = installedSkills?.find((s) => s.name === skillName || s.title === skillName);
501
- if (!installedSkill) {
502
- console.error(`āŒ Installed skill not found: ${skillName}`);
503
- if (installedSkills?.length) {
504
- writeInfo('\nInstalled skills:');
505
- installedSkills.forEach((s) => {
506
- writeInfo(` - ${s.title || s.name}`);
507
- });
508
- }
509
- throw new Error('Operation failed');
510
- }
511
- if (!installedSkill.marketplaceSkillId) {
512
- console.error('āŒ Skill is missing marketplace skill ID.');
513
- throw new Error('Skill is missing marketplace skill ID.');
514
- }
515
- // Parse env vars
516
- let newEnvVars;
517
- if (envVars) {
518
- newEnvVars = {};
519
- const pairs = envVars.split(',');
520
- for (const pair of pairs) {
521
- const [key, ...valueParts] = pair.split('=');
522
- if (key && valueParts.length > 0) {
523
- newEnvVars[key.trim()] = valueParts.join('=').trim();
524
- }
525
- }
526
- }
527
- const updatePayload = {};
528
- if (versionId)
529
- updatePayload.versionId = versionId;
530
- if (newEnvVars)
531
- updatePayload.envVars = newEnvVars;
532
- if (!updatePayload.versionId && !updatePayload.envVars) {
533
- console.error('āŒ No update specified. Provide --version-id or --env-vars.');
534
- throw new Error('No update specified. Provide --version-id or --env-vars.');
535
- }
536
- writeProgress('šŸ”„ Updating installed skill...');
537
- await marketplaceApi.updateInstallation(installedSkill.marketplaceSkillId, agentId, updatePayload);
538
- writeSuccess(`āœ… "${installedSkill.title || installedSkill.name}" updated successfully!`);
539
- }
540
- /**
541
- * Non-interactive: Uninstall a skill
542
- */
543
- async function uninstallSkillNonInteractive(marketplaceApi, config, options) {
544
- const { skillName, force } = options;
545
- if (!skillName) {
546
- console.error('āŒ Missing required option: --skill-name');
547
- console.log('\nUsage: lua marketplace install uninstall --skill-name <name> [--force]');
548
- throw new Error('Missing required option: --skill-name');
549
- }
550
- const agentId = config.agent?.agentId;
551
- if (!agentId) {
552
- console.error('āŒ Agent ID not found in configuration.');
553
- throw new Error('Agent ID not found in configuration.');
554
- }
555
- // Find the installed skill
556
- writeProgress('šŸ”„ Loading installed skills...');
557
- const installedSkills = await marketplaceApi.getInstalledSkills(agentId);
558
- const installedSkill = installedSkills?.find((s) => s.name === skillName || s.title === skillName);
559
- if (!installedSkill) {
560
- console.error(`āŒ Installed skill not found: ${skillName}`);
561
- throw new Error('Installed skill not found: ${skillName}');
562
- }
563
- if (!installedSkill.marketplaceSkillId) {
564
- console.error('āŒ Skill is missing marketplace skill ID.');
565
- throw new Error('Skill is missing marketplace skill ID.');
566
- }
567
- if (!force) {
568
- console.error(`āŒ Use --force to confirm uninstalling "${installedSkill.title || installedSkill.name}"`);
569
- throw new Error('Use --force to confirm uninstalling');
570
- }
571
- writeProgress('šŸ”„ Uninstalling skill...');
572
- await marketplaceApi.uninstallSkill(installedSkill.marketplaceSkillId, agentId);
573
- writeSuccess(`āœ… "${installedSkill.title || installedSkill.name}" uninstalled successfully!`);
574
- }
575
- /**
576
- * Non-interactive: List installed skills
577
- */
578
- async function listInstalledSkillsNonInteractive(marketplaceApi, config, options) {
579
- const agentId = config.agent?.agentId;
580
- if (!agentId) {
581
- console.error('āŒ Agent ID not found in configuration.');
582
- throw new Error('Agent ID not found in configuration.');
583
- }
584
- writeProgress('šŸ”„ Loading installed marketplace skills...');
585
- const skills = await marketplaceApi.getInstalledSkills(agentId);
586
- if (!skills || skills.length === 0) {
587
- writeInfo('šŸ“¦ No marketplace skills installed on this agent.');
588
- return;
589
- }
590
- if (options.json) {
591
- console.log(JSON.stringify(skills, null, 2));
592
- return;
593
- }
594
- console.log(`\nšŸ“Š You have ${skills.length} marketplace skill(s) installed:\n`);
595
- for (const skill of skills) {
596
- console.log(`šŸ“¦ ${skill.title || skill.name}`);
597
- console.log(` ID: ${skill.id}`);
598
- if (skill.marketplaceSkillId) {
599
- console.log(` Marketplace ID: ${skill.marketplaceSkillId}`);
600
- }
601
- if (skill.activeVersionId) {
602
- console.log(` Version: v${skill.activeVersionId}`);
603
- }
604
- if (skill.description) {
605
- console.log(` Description: ${skill.description}`);
606
- }
607
- console.log('');
608
- }
609
- }
610
- async function handleCreatorActions(marketplaceApi, config, apiKey) {
611
- let back = false;
612
- while (!back) {
613
- const creatorAnswer = await safePrompt([
614
- {
615
- type: 'list',
616
- name: 'action',
617
- message: 'Creator Menu:',
618
- choices: [
619
- { name: 'List a new skill on the Marketplace', value: 'list' },
620
- { name: 'Publish a new version of a skill', value: 'publish' },
621
- { name: 'Update metadata for a listed skill', value: 'update' },
622
- { name: 'Unlist a skill from the Marketplace', value: 'unlist' },
623
- { name: 'Unpublish a skill version', value: 'unpublish' },
624
- { name: 'View my listed skills', value: 'view' },
625
- { name: 'Back', value: 'back' },
626
- ],
627
- },
628
- ]);
629
- if (!creatorAnswer || creatorAnswer.action === 'back') {
630
- back = true;
631
- continue;
632
- }
633
- switch (creatorAnswer.action) {
634
- case 'list':
635
- await listSkillOnMarketplace(marketplaceApi, config, apiKey);
636
- continue;
637
- case 'publish':
638
- await publishSkillVersion(marketplaceApi, config, apiKey);
639
- continue;
640
- case 'update':
641
- await updateSkillMetadata(marketplaceApi, config);
642
- continue;
643
- case 'unlist':
644
- await unlistSkillFromMarketplace(marketplaceApi);
645
- continue;
646
- case 'unpublish':
647
- await unpublishSkillVersion(marketplaceApi);
648
- continue;
649
- case 'view':
650
- await viewMyListedSkills(marketplaceApi);
651
- continue;
652
- // Other cases will be added here
653
- default:
654
- console.log(`\nAction '${creatorAnswer.action}' is not implemented yet.\n`);
655
- await safePrompt([
656
- {
657
- type: 'input',
658
- name: 'continue',
659
- message: 'Press Enter to continue...',
660
- },
661
- ]);
662
- continue;
663
- }
664
- }
665
- }
666
- async function listSkillOnMarketplace(marketplaceApi, config, apiKey) {
667
- // 1. Fetch agent skills
668
- const agentId = config.agent?.agentId;
669
- if (!agentId) {
670
- console.error('\nāŒ Agent ID not found in configuration.');
671
- return;
672
- }
673
- const skillApi = new SkillApi(BASE_URLS.API, apiKey, agentId);
674
- writeProgress("šŸ”„ Loading your agent's skills...\n");
675
- const agentSkillsResponse = await skillApi.getSkills();
676
- if (!agentSkillsResponse.success || !agentSkillsResponse.data) {
677
- console.error(`\nāŒ Failed to fetch agent skills: ${agentSkillsResponse.message}\n`);
678
- return;
679
- }
680
- const skills = agentSkillsResponse.data.skills || [];
681
- if (skills.length === 0) {
682
- console.log('\nā„¹ļø No skills found on this agent.');
683
- console.log("šŸ’” Push a skill first using 'lua push skill'.\n");
684
- return;
685
- }
686
- // 2. Prompt user to select a skill to list
687
- const skillAnswer = await safePrompt([
688
- {
689
- type: 'list',
690
- name: 'skill',
691
- message: 'Which skill would you like to list on the marketplace?',
692
- choices: skills.map((s) => ({
693
- name: `${s.name}`,
694
- value: s,
695
- })),
696
- },
697
- ]);
698
- if (!skillAnswer)
699
- return;
700
- const skillToList = skillAnswer.skill;
701
- // 2.5 Check if skill already exists (for re-listing)
702
- writeProgress('\nšŸ”„ Checking existing marketplace listings...');
703
- let defaultDisplayName;
704
- try {
705
- const creatorSkills = await marketplaceApi.getCreatorSkills();
706
- const existingSkill = creatorSkills?.find((s) => s.sourceSkillId === skillToList.id || s.name === skillToList.name);
707
- if (existingSkill) {
708
- if (existingSkill.listed) {
709
- writeInfo(`\nā„¹ļø Skill "${skillToList.name}" is already listed on the marketplace as "${existingSkill.displayName}".\n`);
710
- return;
711
- }
712
- writeInfo(`\nā„¹ļø Skill "${skillToList.name}" was previously listed as "${existingSkill.displayName}". You are re-listing it.`);
713
- defaultDisplayName = existingSkill.displayName;
714
- }
715
- }
716
- catch (error) {
717
- // Ignore error, treat as new listing
718
- }
719
- // 3. Prompt for required metadata
720
- const metadata = await safePrompt([
721
- {
722
- type: 'input',
723
- name: 'displayName',
724
- message: 'Enter a display name for the marketplace:',
725
- default: defaultDisplayName,
726
- validate: (input) => (input && input.trim().length > 0 ? true : 'Display name cannot be empty.'),
727
- },
728
- ]);
729
- if (!metadata)
730
- return;
731
- // 5. Construct payload and list the skill
732
- const payload = {
733
- skillId: skillToList.id,
734
- displayName: metadata.displayName,
735
- // TODO: Add remaining metadata from user
736
- };
737
- try {
738
- writeProgress('\nListing skill on the marketplace...');
739
- const marketplaceSkill = await marketplaceApi.listSkill(payload);
740
- writeSuccess(`\nāœ… Skill "${marketplaceSkill.displayName}" listed successfully!`);
741
- writeInfo(`Marketplace Skill ID: ${marketplaceSkill.id}`);
742
- writeInfo('šŸ’” You can now publish a version to make it installable.\n');
743
- }
744
- catch (error) {
745
- console.error(`\nāŒ Error listing skill: ${error.message}\n`);
746
- }
747
- }
748
- async function publishSkillVersion(marketplaceApi, config, apiKey) {
749
- try {
750
- // 1. Fetch creator's listed marketplace skills
751
- writeProgress('šŸ”„ Loading your marketplace skills...\n');
752
- const creatorSkillsResponse = await marketplaceApi.getCreatorSkills();
753
- // Only show listed skills for publishing versions
754
- const listedMarketplaceSkills = (creatorSkillsResponse || []).filter((s) => s.listed);
755
- if (listedMarketplaceSkills.length === 0) {
756
- writeInfo("\nā„¹ļø You haven't listed any skills on the marketplace yet.");
757
- writeInfo("šŸ’” Please list a skill first using the 'List a new skill' option.\n");
758
- return;
759
- }
760
- // 2. Prompt user to select a listed marketplace skill
761
- const marketplaceSkillAnswer = await safePrompt([
762
- {
763
- type: 'list',
764
- name: 'marketplaceSkill',
765
- message: 'Which skill do you want to publish a new version for?',
766
- choices: listedMarketplaceSkills.map((s) => ({
767
- name: s.displayName,
768
- value: s,
769
- })),
770
- },
771
- ]);
772
- if (!marketplaceSkillAnswer)
773
- return;
774
- const selectedMarketplaceSkill = marketplaceSkillAnswer.marketplaceSkill;
775
- // 3. Fetch agent skills to find the corresponding source skill
776
- const agentId = config.agent?.agentId;
777
- if (!agentId) {
778
- console.error('\nāŒ Agent ID not found in configuration.');
779
- return;
780
- }
781
- const skillApi = new SkillApi(BASE_URLS.API, apiKey, agentId);
782
- writeProgress("šŸ”„ Loading your agent's skills...\n");
783
- const agentSkillsResponse = await skillApi.getSkills();
784
- if (!agentSkillsResponse.success || !agentSkillsResponse.data) {
785
- throw new Error(`Failed to fetch agent skills: ${agentSkillsResponse.message}`);
786
- }
787
- const agentSkills = agentSkillsResponse.data.skills || [];
788
- // Try to find by sourceSkillId first, then by name
789
- let sourceSkill = agentSkills.find((s) => s.id === selectedMarketplaceSkill.sourceSkillId);
790
- if (!sourceSkill) {
791
- // Fallback: try matching by name
792
- sourceSkill = agentSkills.find((s) => s.name === selectedMarketplaceSkill.name);
793
- }
794
- if (!sourceSkill) {
795
- console.error(`\nāŒ Could not find the source skill on your agent.`);
796
- writeInfo(`šŸ’” The skill "${selectedMarketplaceSkill.name}" (ID: ${selectedMarketplaceSkill.sourceSkillId}) is missing from agent ${agentId}.`);
797
- return;
798
- }
799
- // 4. Fetch all available versions for that source skill
800
- writeProgress(`šŸ”„ Loading versions for ${selectedMarketplaceSkill.displayName}...\n`);
801
- const agentSkillVersionsResponse = await skillApi.getSkillVersions(sourceSkill.id);
802
- if (!agentSkillVersionsResponse.success) {
803
- throw new Error(`Failed to fetch skill versions: ${agentSkillVersionsResponse.message}`);
804
- }
805
- const availableAgentVersions = agentSkillVersionsResponse.data?.versions || [];
806
- if (availableAgentVersions.length === 0) {
807
- writeInfo(`\nā„¹ļø No versions found for ${selectedMarketplaceSkill.displayName}.`);
808
- writeInfo("šŸ’” Push a version first using 'lua push skill'.\n");
809
- return;
810
- }
811
- // 4.5 Fetch existing marketplace versions to check status
812
- writeProgress(`\nšŸ”„ Checking marketplace version status...`);
813
- const marketplaceVersions = await marketplaceApi.getSkillVersions(selectedMarketplaceSkill.id);
814
- const getVersionStatus = (version) => {
815
- const mpVersion = marketplaceVersions?.find((v) => v.version === version);
816
- if (!mpVersion)
817
- return { status: 'new', label: 'šŸ“¤ Publish' };
818
- if (mpVersion.published)
819
- return { status: 'published', label: 'āœ… Live' };
820
- return { status: 'unpublished', label: 'šŸ”„ Republish' };
821
- };
822
- // 5. Prompt user to select an agent version to publish
823
- const agentVersionAnswer = await safePrompt([
824
- {
825
- type: 'list',
826
- name: 'agentVersion',
827
- message: 'Select a version to publish:',
828
- choices: availableAgentVersions
829
- .sort((a, b) => compareVersions(b.version, a.version)) // Sort descending
830
- .map((v) => {
831
- const { status, label } = getVersionStatus(v.version);
832
- return {
833
- name: `${label} - v${v.version} (Created: ${new Date(v.createdDate).toLocaleString()})`,
834
- value: { ...v, _status: status },
835
- disabled: status === 'published' ? 'Already published' : false,
836
- };
837
- }),
838
- },
839
- ]);
840
- if (!agentVersionAnswer)
841
- return;
842
- const agentVersionToPublish = agentVersionAnswer.agentVersion;
843
- if (agentVersionToPublish._status === 'unpublished') {
844
- writeInfo(`\nā„¹ļø You are republishing v${agentVersionToPublish.version}. This will make it live again and update its details.\n`);
845
- }
846
- // 6. Prompt for an optional changelog
847
- const existingChangelog = agentVersionToPublish._status === 'unpublished'
848
- ? marketplaceVersions?.find((v) => v.version === agentVersionToPublish.version)?.changelog
849
- : undefined;
850
- const changelogAnswer = await safePrompt([
851
- {
852
- type: 'input',
853
- name: 'changelog',
854
- message: 'Enter a changelog for this version (optional):',
855
- default: existingChangelog,
856
- },
857
- ]);
858
- // 7. Configure environment variables for this version
859
- let initialEnvVars;
860
- if (agentVersionToPublish._status === 'unpublished') {
861
- // Republishing: Use THIS version's existing metadata
862
- initialEnvVars = marketplaceVersions?.find((v) => v.version === agentVersionToPublish.version)?.envVarsMetadata;
863
- }
864
- else {
865
- // New Version: Default to the LATEST existing version's metadata (if any)
866
- const latestVersion = marketplaceVersions?.sort((a, b) => compareVersions(b.version, a.version))[0];
867
- if (latestVersion) {
868
- initialEnvVars = latestVersion.envVarsMetadata;
869
- }
870
- }
871
- const envVars = await handleEnvVarConfiguration(initialEnvVars);
872
- if (envVars === null) {
873
- console.log('\nCancelled publishing process.\n');
874
- return;
875
- }
876
- // 8. Publish the version to the marketplace
877
- const payload = {
878
- versionId: agentVersionToPublish.id,
879
- changelog: changelogAnswer?.changelog || undefined,
880
- envVars: Object.keys(envVars).length > 0 ? envVars : undefined,
881
- };
882
- writeProgress(`\n Publishing version to the marketplace...`);
883
- const publishedVersion = await marketplaceApi.publishVersion(selectedMarketplaceSkill.id, payload);
884
- writeSuccess(`\nāœ… Version ${publishedVersion.version} of "${selectedMarketplaceSkill.displayName}" has been submitted for review!`);
885
- writeInfo('šŸ’” You will be notified once the review is complete.\n');
886
- }
887
- catch (error) {
888
- console.error(`\nāŒ Error publishing skill version: ${error.message}\n`);
889
- }
890
- }
891
- async function updateSkillMetadata(marketplaceApi, config) {
892
- try {
893
- // 1. Fetch creator's listed marketplace skills
894
- writeProgress('šŸ”„ Loading your marketplace skills...\n');
895
- const listedMarketplaceSkills = await marketplaceApi.getCreatorSkills();
896
- if (!listedMarketplaceSkills || listedMarketplaceSkills.length === 0) {
897
- writeInfo("\nā„¹ļø You haven't listed any skills on the marketplace yet.");
898
- writeInfo("šŸ’” Please list a skill first using the 'List a new skill' option.\n");
899
- return;
900
- }
901
- // 2. Prompt user to select a marketplace skill to update
902
- const marketplaceSkillAnswer = await safePrompt([
903
- {
904
- type: 'list',
905
- name: 'marketplaceSkill',
906
- message: 'Which skill would you like to update?',
907
- choices: listedMarketplaceSkills.map((s) => ({
908
- name: s.displayName,
909
- value: s,
910
- })),
911
- },
912
- ]);
913
- if (!marketplaceSkillAnswer)
914
- return;
915
- const marketplaceSkillToUpdate = marketplaceSkillAnswer.marketplaceSkill;
916
- let back = false;
917
- while (!back) {
918
- const actionAnswer = await safePrompt([
919
- {
920
- type: 'list',
921
- name: 'action',
922
- message: `What would you like to update for "${marketplaceSkillToUpdate.displayName}"?`,
923
- choices: [
924
- { name: 'Display Name', value: 'displayName' },
925
- { name: 'Finish Updating', value: 'back' },
926
- ],
927
- },
928
- ]);
929
- const action = actionAnswer?.action || 'back';
930
- if (action === 'back') {
931
- back = true;
932
- continue;
933
- }
934
- if (action === 'displayName') {
935
- await updateDisplayName(marketplaceApi, marketplaceSkillToUpdate);
936
- }
937
- }
938
- // Final success message can be removed as each sub-action gives its own feedback.
939
- }
940
- catch (error) {
941
- console.error(`\nāŒ Error updating skill metadata: ${error.message}\n`);
942
- }
943
- }
944
- async function updateDisplayName(marketplaceApi, marketplaceSkill) {
945
- const newDisplayNameAnswer = await safePrompt([
946
- {
947
- type: 'input',
948
- name: 'newDisplayName',
949
- message: `Enter the new display name for "${marketplaceSkill.displayName}":`,
950
- default: marketplaceSkill.displayName,
951
- validate: (input) => (input && input.trim().length > 0 ? true : 'Display name cannot be empty.'),
952
- },
953
- ]);
954
- if (!newDisplayNameAnswer)
955
- return;
956
- const newDisplayName = newDisplayNameAnswer.newDisplayName;
957
- const payload = { displayName: newDisplayName };
958
- writeProgress(`\nUpdating display name...`);
959
- await marketplaceApi.updateSkill(marketplaceSkill.id, payload);
960
- writeSuccess(`\nāœ… Display name updated successfully to "${newDisplayName}"!\n`);
961
- marketplaceSkill.displayName = newDisplayName; // Update in-memory object for sub-menu display
962
- }
963
- /**
964
- * Unlist a skill from the marketplace
965
- */
966
- async function unlistSkillFromMarketplace(marketplaceApi) {
967
- try {
968
- // 1. Fetch creator's listed marketplace skills
969
- writeProgress('šŸ”„ Loading your marketplace skills...\n');
970
- const listedMarketplaceSkills = await marketplaceApi.getCreatorSkills();
971
- if (!listedMarketplaceSkills || listedMarketplaceSkills.length === 0) {
972
- writeInfo("\nā„¹ļø You haven't listed any skills on the marketplace yet.");
973
- writeInfo("šŸ’” Please list a skill first using the 'List a new skill' option.\n");
974
- return;
975
- }
976
- // Filter to only show listed skills
977
- const activeListedSkills = listedMarketplaceSkills.filter((s) => s.listed);
978
- if (activeListedSkills.length === 0) {
979
- writeInfo("\nā„¹ļø You don't have any active listings on the marketplace.");
980
- writeInfo('šŸ’” All your skills are already unlisted.\n');
981
- return;
982
- }
983
- // 2. Prompt user to select a marketplace skill to unlist
984
- const marketplaceSkillAnswer = await safePrompt([
985
- {
986
- type: 'list',
987
- name: 'marketplaceSkill',
988
- message: 'Which skill would you like to unlist from the marketplace?',
989
- choices: activeListedSkills.map((s) => ({
990
- name: `${s.displayName} (${s.name})`,
991
- value: s,
992
- })),
993
- },
994
- ]);
995
- if (!marketplaceSkillAnswer)
996
- return;
997
- const marketplaceSkillToUnlist = marketplaceSkillAnswer.marketplaceSkill;
998
- // 3. Confirm the action
999
- const confirmAnswer = await safePrompt([
1000
- {
1001
- type: 'confirm',
1002
- name: 'confirm',
1003
- message: `āš ļø Are you sure you want to unlist "${marketplaceSkillToUnlist.displayName}"? This will unpublish all versions and remove it from the marketplace.`,
1004
- default: false,
1005
- },
1006
- ]);
1007
- if (!confirmAnswer || !confirmAnswer.confirm) {
1008
- writeInfo('\nāŒ Unlist cancelled.\n');
1009
- return;
1010
- }
1011
- // 4. Unlist the skill
1012
- writeProgress('\nšŸ”„ Unlisting skill from marketplace...');
1013
- await marketplaceApi.unlistSkill(marketplaceSkillToUnlist.id);
1014
- writeSuccess(`\nāœ… "${marketplaceSkillToUnlist.displayName}" has been unlisted from the marketplace.`);
1015
- writeInfo("šŸ’” You can re-list it anytime using the 'List a new skill' option.\n");
1016
- }
1017
- catch (error) {
1018
- console.error(`\nāŒ Error unlisting skill: ${error.message}\n`);
1019
- }
1020
- }
1021
- /**
1022
- * Unpublish a specific version of a marketplace skill
1023
- */
1024
- async function unpublishSkillVersion(marketplaceApi) {
1025
- try {
1026
- // 1. Fetch creator's listed marketplace skills
1027
- writeProgress('šŸ”„ Loading your marketplace skills...\n');
1028
- const listedMarketplaceSkills = await marketplaceApi.getCreatorSkills();
1029
- if (!listedMarketplaceSkills || listedMarketplaceSkills.length === 0) {
1030
- writeInfo("\nā„¹ļø You haven't listed any skills on the marketplace yet.");
1031
- writeInfo("šŸ’” Please list a skill first using the 'List a new skill' option.\n");
1032
- return;
1033
- }
1034
- // 2. Prompt user to select a marketplace skill
1035
- const marketplaceSkillAnswer = await safePrompt([
1036
- {
1037
- type: 'list',
1038
- name: 'marketplaceSkill',
1039
- message: 'Which skill has the version you want to unpublish?',
1040
- choices: listedMarketplaceSkills.map((s) => ({
1041
- name: `${s.displayName} (${s.name})`,
1042
- value: s,
1043
- })),
1044
- },
1045
- ]);
1046
- if (!marketplaceSkillAnswer)
1047
- return;
1048
- const selectedMarketplaceSkill = marketplaceSkillAnswer.marketplaceSkill;
1049
- // 3. Fetch versions for the selected skill
1050
- writeProgress(`\nšŸ”„ Loading versions for ${selectedMarketplaceSkill.displayName}...\n`);
1051
- const versions = await marketplaceApi.getSkillVersions(selectedMarketplaceSkill.id);
1052
- const publishedVersions = (versions || []).filter((v) => v.published);
1053
- if (publishedVersions.length === 0) {
1054
- writeInfo(`\nā„¹ļø No published versions found for "${selectedMarketplaceSkill.displayName}".`);
1055
- writeInfo('šŸ’” All versions are already unpublished.\n');
1056
- return;
1057
- }
1058
- // 4. Prompt user to select a version to unpublish
1059
- const versionAnswer = await safePrompt([
1060
- {
1061
- type: 'list',
1062
- name: 'version',
1063
- message: 'Which version would you like to unpublish?',
1064
- choices: publishedVersions
1065
- .sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime())
1066
- .map((v) => ({
1067
- name: `v${v.version} - ${new Date(v.createdAt).toLocaleDateString()}`,
1068
- value: v,
1069
- })),
1070
- },
1071
- ]);
1072
- if (!versionAnswer)
1073
- return;
1074
- const versionToUnpublish = versionAnswer.version;
1075
- // 5. Confirm the action
1076
- const confirmAnswer = await safePrompt([
1077
- {
1078
- type: 'confirm',
1079
- name: 'confirm',
1080
- message: `āš ļø Are you sure you want to unpublish version ${versionToUnpublish.version} of "${selectedMarketplaceSkill.displayName}"?`,
1081
- default: false,
1082
- },
1083
- ]);
1084
- if (!confirmAnswer || !confirmAnswer.confirm) {
1085
- writeInfo('\nāŒ Unpublish cancelled.\n');
1086
- return;
1087
- }
1088
- // 6. Unpublish the version
1089
- writeProgress('\nšŸ”„ Unpublishing version...');
1090
- await marketplaceApi.unpublishVersion(selectedMarketplaceSkill.id, versionToUnpublish.id);
1091
- writeSuccess(`\nāœ… Version ${versionToUnpublish.version} of "${selectedMarketplaceSkill.displayName}" has been unpublished.`);
1092
- writeInfo('šŸ’” Users can no longer install this version. You can publish it again anytime.\n');
1093
- }
1094
- catch (error) {
1095
- console.error(`\nāŒ Error unpublishing version: ${error.message}\n`);
1096
- }
1097
- }
1098
- /**
1099
- * View all listed skills created by the user
1100
- */
1101
- async function viewMyListedSkills(marketplaceApi) {
1102
- try {
1103
- writeProgress('šŸ”„ Loading your marketplace skills...\n');
1104
- const listedMarketplaceSkills = await marketplaceApi.getCreatorSkills();
1105
- if (!listedMarketplaceSkills || listedMarketplaceSkills.length === 0) {
1106
- writeInfo("\nšŸ“¦ You haven't listed any skills on the marketplace yet.");
1107
- writeInfo("šŸ’” Use 'List a new skill' to get started.\n");
1108
- return;
1109
- }
1110
- // Display summary
1111
- console.log(`\nšŸ“Š You have ${listedMarketplaceSkills.length} skill(s) on the marketplace:\n`);
1112
- // Display each skill
1113
- for (const skill of listedMarketplaceSkills) {
1114
- const statusIcon = skill.listed ? 'āœ…' : 'āŒ';
1115
- const statusText = skill.listed ? 'Listed' : 'Unlisted';
1116
- console.log(`${statusIcon} ${skill.displayName} (${skill.name})`);
1117
- console.log(` Status: ${statusText}`);
1118
- if (skill.description) {
1119
- console.log(` Description: ${skill.description}`);
1120
- }
1121
- if (skill.category) {
1122
- console.log(` Category: ${skill.category}`);
1123
- }
1124
- if (skill.tags && skill.tags.length > 0) {
1125
- console.log(` Tags: ${skill.tags.join(', ')}`);
1126
- }
1127
- if (skill.verified)
1128
- console.log(` ✨ Verified Creator`);
1129
- if (skill.featured)
1130
- console.log(` ⭐ Featured Skill`);
1131
- if (skill.createdAt) {
1132
- console.log(` Created: ${new Date(skill.createdAt).toLocaleDateString()}`);
1133
- }
1134
- if (skill.updatedAt) {
1135
- console.log(` Last Updated: ${new Date(skill.updatedAt).toLocaleDateString()}`);
1136
- }
1137
- // Show version info if available
1138
- if (skill.versions && skill.versions.length > 0) {
1139
- const publishedVersions = skill.versions.filter((v) => v.published);
1140
- const totalVersions = skill.versions.length;
1141
- console.log(` Versions: ${publishedVersions.length} published / ${totalVersions} total`);
1142
- if (publishedVersions.length > 0) {
1143
- const latestVersion = publishedVersions.sort((a, b) => compareVersions(b.version, a.version))[0];
1144
- console.log(` Latest Published: v${latestVersion.version}`);
1145
- }
1146
- }
1147
- // Show install count if available
1148
- if (typeof skill.installCount !== 'undefined') {
1149
- console.log(` Installs: ${skill.installCount}`);
1150
- }
1151
- // Show environment variables from latest version
1152
- const latestVersion = skill.versions && skill.versions.length > 0
1153
- ? skill.versions.sort((a, b) => compareVersions(b.version, a.version))[0]
1154
- : null;
1155
- if (latestVersion && latestVersion.envVarsMetadata && Object.keys(latestVersion.envVarsMetadata).length > 0) {
1156
- const envKeys = Object.keys(latestVersion.envVarsMetadata).join(', ');
1157
- console.log(` Environment Variables (latest version): ${envKeys} (${Object.keys(latestVersion.envVarsMetadata).length} configured)`);
1158
- }
1159
- console.log(''); // Empty line between skills
1160
- }
1161
- // Prompt to continue
1162
- await safePrompt([
1163
- {
1164
- type: 'input',
1165
- name: 'continue',
1166
- message: 'Press Enter to continue...',
1167
- },
1168
- ]);
1169
- }
1170
- catch (error) {
1171
- console.error(`\nāŒ Error loading your skills: ${error.message}\n`);
1172
- }
1173
- }
1174
- /**
1175
- * Handle env var configuration
1176
- * Builds an environment variable configuration object interactively.
1177
- * Used for both listing new skills and updating existing ones.
1178
- */
1179
- async function handleEnvVarConfiguration(initialEnvVars) {
1180
- const detectedKeys = loadSandboxEnvVariables().map((v) => v.key);
1181
- let envVars = initialEnvVars ? { ...initialEnvVars } : {};
1182
- let continueManaging = true;
1183
- while (continueManaging) {
1184
- const keys = Object.keys(envVars);
1185
- const statusText = keys.length > 0 ? `Current: ${keys.length} configured (${keys.join(', ')})` : 'Current: None configured';
1186
- const actionAnswer = await safePrompt([
1187
- {
1188
- type: 'list',
1189
- name: 'action',
1190
- message: `Manage environment variables (${statusText}):`,
1191
- choices: [
1192
- { name: 'Add a new variable', value: 'add' },
1193
- { name: 'Edit an existing variable', value: 'edit' },
1194
- { name: 'Delete a variable', value: 'delete' },
1195
- new inquirer.Separator(),
1196
- { name: 'Finish and continue', value: 'done' },
1197
- ],
1198
- },
1199
- ]);
1200
- if (!actionAnswer || actionAnswer.action === 'done') {
1201
- continueManaging = false;
1202
- continue;
1203
- }
1204
- const { action } = actionAnswer;
1205
- switch (action) {
1206
- case 'add':
1207
- await handleEnvVarAction('add', envVars, detectedKeys);
1208
- break;
1209
- case 'edit':
1210
- await handleEnvVarAction('edit', envVars, detectedKeys);
1211
- break;
1212
- case 'delete':
1213
- await handleEnvVarAction('delete', envVars, detectedKeys);
1214
- break;
1215
- }
1216
- }
1217
- return envVars;
1218
- }
1219
- async function handleEnvVarAction(action, envVars, detectedKeys) {
1220
- const keys = Object.keys(envVars);
1221
- if (action === 'add') {
1222
- const unconfiguredKeys = detectedKeys.filter((k) => !envVars[k]);
1223
- const choices = [
1224
- ...unconfiguredKeys.map((key) => ({
1225
- name: `From .env file: ${key}`,
1226
- value: key,
1227
- })),
1228
- new inquirer.Separator(),
1229
- { name: 'Manually enter a variable name', value: 'manual' },
1230
- { name: 'Back', value: 'back' },
1231
- ];
1232
- const varNameAnswer = await safePrompt([
1233
- {
1234
- type: 'list',
1235
- name: 'varName',
1236
- message: 'How would you like to add a variable?',
1237
- choices,
1238
- },
1239
- ]);
1240
- if (!varNameAnswer || varNameAnswer.varName === 'back')
1241
- return;
1242
- let keyToAdd = varNameAnswer.varName;
1243
- if (keyToAdd === 'manual') {
1244
- const manualKeyAnswer = await safePrompt([
1245
- {
1246
- type: 'input',
1247
- name: 'manualKey',
1248
- message: 'Enter the new variable name:',
1249
- validate: (input) => (input?.trim().length > 0 ? true : 'Name cannot be empty.'),
1250
- },
1251
- ]);
1252
- if (!manualKeyAnswer)
1253
- return;
1254
- keyToAdd = manualKeyAnswer.manualKey;
1255
- }
1256
- await configureEnvVar(keyToAdd, envVars);
1257
- }
1258
- else if (action === 'edit') {
1259
- if (keys.length === 0) {
1260
- writeInfo('\nā„¹ļø No variables configured yet. Please add one first.\n');
1261
- return;
1262
- }
1263
- const keyAnswer = await safePrompt([
1264
- {
1265
- type: 'list',
1266
- name: 'key',
1267
- message: 'Which variable do you want to edit?',
1268
- choices: [...keys, new inquirer.Separator(), { name: 'Back', value: 'back' }],
1269
- },
1270
- ]);
1271
- if (!keyAnswer || keyAnswer.key === 'back')
1272
- return;
1273
- await configureEnvVar(keyAnswer.key, envVars);
1274
- }
1275
- else if (action === 'delete') {
1276
- if (keys.length === 0) {
1277
- writeInfo('\nā„¹ļø No variables configured yet.\n');
1278
- return;
1279
- }
1280
- const keyAnswer = await safePrompt([
1281
- {
1282
- type: 'list',
1283
- name: 'key',
1284
- message: 'Which variable do you want to delete?',
1285
- choices: [...keys, new inquirer.Separator(), { name: 'Back', value: 'back' }],
1286
- },
1287
- ]);
1288
- if (!keyAnswer || keyAnswer.key === 'back')
1289
- return;
1290
- delete envVars[keyAnswer.key];
1291
- writeSuccess(`\nāœ… Variable "${keyAnswer.key}" has been removed.\n`);
1292
- }
1293
- }
1294
- async function configureEnvVar(varName, envVars) {
1295
- const existing = envVars[varName] || {};
1296
- const metadata = await safePrompt([
1297
- {
1298
- type: 'input',
1299
- name: 'description',
1300
- message: `Description for ${varName}:`,
1301
- default: existing.description,
1302
- validate: (input) => (input?.trim().length > 0 ? true : 'Description cannot be empty.'),
1303
- },
1304
- {
1305
- type: 'confirm',
1306
- name: 'required',
1307
- message: 'Is this variable required?',
1308
- default: existing.required !== undefined ? existing.required : true,
1309
- },
1310
- {
1311
- type: 'input',
1312
- name: 'example',
1313
- message: 'Example value (optional):',
1314
- default: existing.example,
1315
- },
1316
- ]);
1317
- if (!metadata)
1318
- return;
1319
- envVars[varName] = {
1320
- description: metadata.description,
1321
- required: metadata.required,
1322
- example: metadata.example || undefined,
1323
- };
1324
- writeSuccess(`\nāœ… Configured ${varName}.\n`);
1325
- }
1326
- async function handleInstallerActions(marketplaceApi, config, apiKey) {
1327
- let back = false;
1328
- while (!back) {
1329
- const installerAnswer = await safePrompt([
1330
- {
1331
- type: 'list',
1332
- name: 'action',
1333
- message: 'Installer Menu:',
1334
- choices: [
1335
- { name: 'Browse & Search for skills', value: 'search' },
1336
- { name: 'Install a skill from the Marketplace', value: 'install' },
1337
- { name: 'Update an installed skill', value: 'update' },
1338
- { name: 'Uninstall a skill', value: 'uninstall' },
1339
- { name: 'List my currently installed skills', value: 'installed' },
1340
- { name: 'Back', value: 'back' },
1341
- ],
1342
- },
1343
- ]);
1344
- if (!installerAnswer || installerAnswer.action === 'back') {
1345
- back = true;
1346
- continue;
1347
- }
1348
- switch (installerAnswer.action) {
1349
- case 'search':
1350
- await searchMarketplaceSkills(marketplaceApi);
1351
- continue;
1352
- case 'install':
1353
- await installMarketplaceSkill(marketplaceApi, config, apiKey);
1354
- continue;
1355
- case 'update':
1356
- await updateInstalledSkill(marketplaceApi, config, apiKey);
1357
- continue;
1358
- case 'uninstall':
1359
- await uninstallMarketplaceSkill(marketplaceApi, config);
1360
- continue;
1361
- case 'installed':
1362
- await listInstalledSkills(marketplaceApi, config);
1363
- continue;
1364
- // Other cases will be added here
1365
- default:
1366
- console.log(`\nAction '${installerAnswer.action}' is not implemented yet.\n`);
1367
- await safePrompt([
1368
- {
1369
- type: 'input',
1370
- name: 'continue',
1371
- message: 'Press Enter to continue...',
1372
- },
1373
- ]);
1374
- continue;
1375
- }
1376
- }
1377
- }
1378
- const MARKETPLACE_PAGE_SIZE = 10;
1379
- /**
1380
- * Browse and select a skill from marketplace (with optional search and pagination)
1381
- * Returns the selected skill or null if cancelled
1382
- */
1383
- async function browseAndSelectSkill(marketplaceApi, purpose, publishedVersionsOnly) {
1384
- try {
1385
- // 1. Prompt for search query (optional)
1386
- const searchAnswer = await safePrompt([
1387
- {
1388
- type: 'input',
1389
- name: 'query',
1390
- message: 'Search for skills (leave empty to browse all):',
1391
- },
1392
- ]);
1393
- if (searchAnswer === null)
1394
- return null; // User cancelled
1395
- const searchQuery = searchAnswer?.query?.trim() || '';
1396
- let currentPage = 1;
1397
- // Pagination loop
1398
- while (true) {
1399
- // 2. Search/browse marketplace skills with pagination
1400
- writeProgress(searchQuery ? `\nšŸ” Searching for "${searchQuery}"...` : '\nšŸ” Loading marketplace skills...');
1401
- const filters = {
1402
- limit: MARKETPLACE_PAGE_SIZE,
1403
- page: currentPage,
1404
- };
1405
- if (searchQuery)
1406
- filters.search = searchQuery;
1407
- if (publishedVersionsOnly !== undefined)
1408
- filters.publishedVersionsOnly = publishedVersionsOnly;
1409
- const searchResults = await marketplaceApi.searchSkills(filters);
1410
- const skills = searchResults?.data || [];
1411
- const pagination = searchResults?.pagination;
1412
- const totalCount = pagination?.totalCount || skills.length;
1413
- const totalPages = pagination?.totalPages || 1;
1414
- const hasNextPage = pagination?.hasNextPage || false;
1415
- const hasPrevPage = pagination?.hasPrevPage || false;
1416
- if (skills.length === 0 && currentPage === 1) {
1417
- if (searchQuery) {
1418
- writeInfo(`\nšŸ“¦ No skills found matching "${searchQuery}".`);
1419
- }
1420
- else {
1421
- writeInfo('\nšŸ“¦ No skills available on the marketplace yet.');
1422
- }
1423
- writeInfo('šŸ’” Be the first to publish a skill!\n');
1424
- return null;
1425
- }
1426
- // 3. Display results with pagination info
1427
- const pageInfo = totalPages > 1 ? ` (Page ${currentPage}/${totalPages})` : '';
1428
- console.log(`\nšŸ“Š Found ${totalCount} skill${totalCount === 1 ? '' : 's'}${pageInfo}:\n`);
1429
- // 4. Build choices with pagination navigation
1430
- const choices = [
1431
- ...skills.map((s) => ({
1432
- name: `${s.displayName} - ${s.description || 'No description'}`,
1433
- value: { type: 'skill', skill: s },
1434
- })),
1435
- ];
1436
- // Add pagination options
1437
- if (hasNextPage || hasPrevPage) {
1438
- choices.push(new inquirer.Separator());
1439
- if (hasPrevPage) {
1440
- choices.push({
1441
- name: `← Previous page (${currentPage - 1}/${totalPages})`,
1442
- value: { type: 'prev' },
1443
- });
1444
- }
1445
- if (hasNextPage) {
1446
- choices.push({
1447
- name: `→ Next page (${currentPage + 1}/${totalPages})`,
1448
- value: { type: 'next' },
1449
- });
1450
- }
1451
- }
1452
- choices.push(new inquirer.Separator());
1453
- choices.push({ name: '← Back to menu', value: { type: 'back' } });
1454
- // 5. Prompt user to select
1455
- const message = purpose || 'Select a skill:';
1456
- const answer = await safePrompt([
1457
- {
1458
- type: 'list',
1459
- name: 'selection',
1460
- message,
1461
- choices,
1462
- pageSize: MARKETPLACE_PAGE_SIZE + 5, // Show all items + navigation options
1463
- },
1464
- ]);
1465
- if (!answer || !answer.selection)
1466
- return null;
1467
- const { selection } = answer;
1468
- if (selection.type === 'skill' && selection.skill) {
1469
- return selection.skill;
1470
- }
1471
- else if (selection.type === 'next') {
1472
- currentPage++;
1473
- }
1474
- else if (selection.type === 'prev') {
1475
- currentPage--;
1476
- }
1477
- else if (selection.type === 'back') {
1478
- return null;
1479
- }
1480
- }
1481
- }
1482
- catch (error) {
1483
- console.error(`\nāŒ Error browsing marketplace: ${error.message}\n`);
1484
- return null;
1485
- }
1486
- }
1487
- /**
1488
- * Browse and search for marketplace skills (view details)
1489
- */
1490
- async function searchMarketplaceSkills(marketplaceApi) {
1491
- const selectedSkill = await browseAndSelectSkill(marketplaceApi, 'Select a skill to view details:', true // Only show skills with published & approved versions
1492
- );
1493
- if (selectedSkill) {
1494
- await showSkillDetails(marketplaceApi, selectedSkill);
1495
- }
1496
- }
1497
- /**
1498
- * Show detailed information about a marketplace skill
1499
- */
1500
- async function showSkillDetails(marketplaceApi, skill) {
1501
- try {
1502
- // Fetch full details
1503
- writeProgress('\nšŸ”„ Loading skill details...\n');
1504
- const skillDetails = await marketplaceApi.getSkillById(skill.id);
1505
- // Display detailed information
1506
- console.log(`\n${'='.repeat(60)}`);
1507
- console.log(`šŸ“¦ ${skillDetails.displayName}`);
1508
- console.log(`${'='.repeat(60)}\n`);
1509
- console.log(`Name: ${skillDetails.name}`);
1510
- console.log(`Created: ${new Date(skillDetails.createdAt).toLocaleDateString()}`);
1511
- console.log(`Last Updated: ${new Date(skillDetails.updatedAt).toLocaleDateString()}`);
1512
- if (skillDetails.description) {
1513
- console.log(`\nDescription: ${skillDetails.description}`);
1514
- }
1515
- if (skillDetails.longDescription) {
1516
- console.log(`\nDetails:\n${skillDetails.longDescription}`);
1517
- }
1518
- if (skillDetails.category) {
1519
- console.log(`\nCategory: ${skillDetails.category}`);
1520
- }
1521
- if (skillDetails.tags && skillDetails.tags.length > 0) {
1522
- console.log(`Tags: ${skillDetails.tags.join(', ')}`);
1523
- }
1524
- // Show install count
1525
- if (typeof skillDetails.installCount !== 'undefined') {
1526
- console.log(`Installs: ${skillDetails.installCount}`);
1527
- }
1528
- // Show verified/featured badges
1529
- if (skillDetails.verified) {
1530
- console.log(`āœ… Verified`);
1531
- }
1532
- if (skillDetails.featured) {
1533
- console.log(`⭐ Featured`);
1534
- }
1535
- // Show versions
1536
- if (skillDetails.versions && skillDetails.versions.length > 0) {
1537
- const publishedVersions = skillDetails.versions.filter((v) => v.published);
1538
- console.log(`\nVersions: ${publishedVersions.length} published / ${skillDetails.versions.length} total`);
1539
- if (publishedVersions.length > 0) {
1540
- const latestVersion = publishedVersions.sort((a, b) => compareVersions(b.version, a.version))[0];
1541
- console.log(`Latest: v${latestVersion.version}`);
1542
- if (latestVersion.tools && latestVersion.tools.length > 0) {
1543
- console.log(`\nTools (v${latestVersion.version}):`);
1544
- latestVersion.tools.forEach((tool) => {
1545
- console.log(` • ${tool.name || tool.functionName || 'Unnamed Tool'}`);
1546
- if (tool.description)
1547
- console.log(` ${tool.description}`);
1548
- });
1549
- }
1550
- }
1551
- }
1552
- // Show environment variables from latest version
1553
- const latestVersion = skillDetails.versions && skillDetails.versions.length > 0
1554
- ? skillDetails.versions.sort((a, b) => compareVersions(b.version, a.version))[0]
1555
- : null;
1556
- if (latestVersion && latestVersion.envVarsMetadata && Object.keys(latestVersion.envVarsMetadata).length > 0) {
1557
- console.log(`\nEnvironment Variables (v${latestVersion.version}):`);
1558
- for (const [key, meta] of Object.entries(latestVersion.envVarsMetadata)) {
1559
- const varMeta = meta;
1560
- const required = varMeta.required ? ' (required)' : ' (optional)';
1561
- console.log(` • ${key}${required}`);
1562
- if (varMeta.description) {
1563
- console.log(` ${varMeta.description}`);
1564
- }
1565
- }
1566
- }
1567
- // Show repository and documentation links
1568
- if (skillDetails.repositoryUrl) {
1569
- console.log(`\nRepository: ${skillDetails.repositoryUrl}`);
1570
- }
1571
- if (skillDetails.documentationUrl) {
1572
- console.log(`Documentation: ${skillDetails.documentationUrl}`);
1573
- }
1574
- console.log(`\n${'='.repeat(60)}\n`);
1575
- // Prompt to continue
1576
- await safePrompt([
1577
- {
1578
- type: 'input',
1579
- name: 'continue',
1580
- message: 'Press Enter to continue...',
1581
- },
1582
- ]);
1583
- }
1584
- catch (error) {
1585
- console.error(`\nāŒ Error loading skill details: ${error.message}\n`);
1586
- }
1587
- }
1588
- /**
1589
- * Install a marketplace skill on the agent
1590
- */
1591
- async function installMarketplaceSkill(marketplaceApi, config, apiKey) {
1592
- try {
1593
- const agentId = config.agent?.agentId;
1594
- if (!agentId) {
1595
- console.error('\nāŒ No agent ID found in configuration.\n');
1596
- return;
1597
- }
1598
- // 1. Choose how to select the skill
1599
- const selectionMethodAnswer = await safePrompt([
1600
- {
1601
- type: 'list',
1602
- name: 'method',
1603
- message: 'How would you like to find the skill?',
1604
- choices: [
1605
- { name: 'Browse and select from marketplace', value: 'browse' },
1606
- { name: 'Enter skill name and creator ID directly', value: 'direct' },
1607
- { name: 'Cancel', value: 'cancel' },
1608
- ],
1609
- },
1610
- ]);
1611
- if (!selectionMethodAnswer || selectionMethodAnswer.method === 'cancel') {
1612
- return;
1613
- }
1614
- let selectedMarketplaceSkill = null;
1615
- if (selectionMethodAnswer.method === 'browse') {
1616
- // Browse and select - only show skills with published versions
1617
- selectedMarketplaceSkill = await browseAndSelectSkill(marketplaceApi, undefined, true);
1618
- if (!selectedMarketplaceSkill)
1619
- return; // User cancelled or no skills found
1620
- }
1621
- else {
1622
- // Direct entry
1623
- const directAnswer = await safePrompt([
1624
- {
1625
- type: 'input',
1626
- name: 'name',
1627
- message: 'Enter the skill name:',
1628
- validate: (input) => (input.trim().length > 0 ? true : 'Skill name is required'),
1629
- },
1630
- {
1631
- type: 'input',
1632
- name: 'creatorId',
1633
- message: 'Enter the creator ID:',
1634
- validate: (input) => (input.trim().length > 0 ? true : 'Creator ID is required'),
1635
- },
1636
- ]);
1637
- if (!directAnswer)
1638
- return;
1639
- // Search for the skill by exact name and creator using API filters
1640
- writeProgress('\nšŸ” Looking up skill...');
1641
- const searchResults = await marketplaceApi.searchSkills({
1642
- name: directAnswer.name,
1643
- creatorId: directAnswer.creatorId,
1644
- publishedVersionsOnly: true,
1645
- });
1646
- const skills = searchResults?.data || [];
1647
- if (skills.length === 0) {
1648
- console.error(`\nāŒ Skill "${directAnswer.name}" by creator "${directAnswer.creatorId}" not found on the marketplace.\n`);
1649
- return;
1650
- }
1651
- // Should only have one result with exact name + creatorId match
1652
- selectedMarketplaceSkill = skills[0];
1653
- }
1654
- // Check if the skill is already installed on this agent (as a marketplace skill)
1655
- try {
1656
- const installedSkills = await marketplaceApi.getInstalledSkills(agentId);
1657
- const alreadyInstalled = installedSkills?.find((s) => s.marketplaceSkillId === selectedMarketplaceSkill.id);
1658
- if (alreadyInstalled) {
1659
- console.error(`\nāŒ The skill "${selectedMarketplaceSkill.displayName}" is already installed on this agent.`);
1660
- writeInfo("šŸ’” Use 'Update an installed skill' to change versions or configuration.\n");
1661
- return;
1662
- }
1663
- }
1664
- catch (e) {
1665
- // Silent catch - if we can't check, let the backend handle the error later
1666
- }
1667
- try {
1668
- const skillApi = new SkillApi(BASE_URLS.API, apiKey, agentId);
1669
- const agentSkillsResponse = await skillApi.getSkills();
1670
- if (agentSkillsResponse.success && agentSkillsResponse.data?.skills) {
1671
- const agentSkills = agentSkillsResponse.data.skills;
1672
- const existingSourceSkill = agentSkills.find((s) => s.id === selectedMarketplaceSkill.sourceSkillId);
1673
- if (existingSourceSkill) {
1674
- console.error(`\nāŒ You cannot install "${selectedMarketplaceSkill.displayName}" because the source skill already exists on this agent.`);
1675
- writeInfo('šŸ’” You already have the original skill on this agent.\n');
1676
- return;
1677
- }
1678
- }
1679
- }
1680
- catch (e) {
1681
- // Silent catch
1682
- }
1683
- // 2. Fetch full skill details including versions
1684
- writeProgress(`\nšŸ”„ Loading details for ${selectedMarketplaceSkill.displayName}...`);
1685
- const skillDetails = await marketplaceApi.getSkillById(selectedMarketplaceSkill.id);
1686
- // 3. Get published versions
1687
- const versions = await marketplaceApi.getSkillVersions(selectedMarketplaceSkill.id);
1688
- const publishedVersions = (versions || []).filter((v) => v.published);
1689
- if (publishedVersions.length === 0) {
1690
- writeInfo(`\nāŒ No published versions available for "${skillDetails.displayName}".`);
1691
- writeInfo('šŸ’” Please contact the skill creator to publish a version.\n');
1692
- return;
1693
- }
1694
- // 4. Select version to install
1695
- const versionAnswer = await safePrompt([
1696
- {
1697
- type: 'list',
1698
- name: 'version',
1699
- message: 'Select a version to install:',
1700
- choices: publishedVersions
1701
- .sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime())
1702
- .map((v) => ({
1703
- name: `v${v.version} - ${new Date(v.createdAt).toLocaleDateString()}${v.changelog ? ` - ${v.changelog}` : ''}`,
1704
- value: v,
1705
- })),
1706
- },
1707
- ]);
1708
- if (!versionAnswer)
1709
- return;
1710
- const selectedVersion = versionAnswer.version;
1711
- // 5. Configure environment variables
1712
- const envVarsConfig = {};
1713
- const versionEnvVars = selectedVersion.envVarsMetadata || {};
1714
- if (Object.keys(versionEnvVars).length > 0) {
1715
- writeInfo('\nšŸ“ Configure environment variables:\n');
1716
- for (const [key, meta] of Object.entries(versionEnvVars)) {
1717
- const varMeta = meta;
1718
- const isRequired = varMeta.required;
1719
- const description = varMeta.description || 'No description';
1720
- const example = varMeta.example ? ` (e.g., ${varMeta.example})` : '';
1721
- console.log(`\n${key}${isRequired ? ' (required)' : ' (optional)'}`);
1722
- console.log(` ${description}${example}`);
1723
- const valueAnswer = await safePrompt([
1724
- {
1725
- type: 'input',
1726
- name: 'value',
1727
- message: `Enter value for ${key}:`,
1728
- validate: (input) => {
1729
- if (isRequired && !input.trim()) {
1730
- return `${key} is required`;
1731
- }
1732
- return true;
1733
- },
1734
- },
1735
- ]);
1736
- if (valueAnswer === null) {
1737
- writeInfo('\nāŒ Installation cancelled.\n');
1738
- return;
1739
- }
1740
- if (valueAnswer.value && valueAnswer.value.trim()) {
1741
- envVarsConfig[key] = valueAnswer.value.trim();
1742
- }
1743
- }
1744
- }
1745
- // 6. Confirm installation
1746
- console.log('\nšŸ“‹ Installation Summary:');
1747
- console.log(` Skill: ${skillDetails.displayName}`);
1748
- console.log(` Version: v${selectedVersion.version}`);
1749
- console.log(` Agent: ${agentId}`);
1750
- if (Object.keys(envVarsConfig).length > 0) {
1751
- console.log(` Environment Variables: ${Object.keys(envVarsConfig).length} configured`);
1752
- }
1753
- const confirmAnswer = await safePrompt([
1754
- {
1755
- type: 'confirm',
1756
- name: 'confirm',
1757
- message: 'Proceed with installation?',
1758
- default: true,
1759
- },
1760
- ]);
1761
- if (!confirmAnswer || !confirmAnswer.confirm) {
1762
- writeInfo('\nāŒ Installation cancelled.\n');
1763
- return;
1764
- }
1765
- // 7. Install the skill
1766
- writeProgress('\nšŸ”„ Installing skill...');
1767
- const installPayload = {
1768
- versionId: selectedVersion.id,
1769
- envVars: Object.keys(envVarsConfig).length > 0 ? envVarsConfig : undefined,
1770
- };
1771
- await marketplaceApi.installSkill(selectedMarketplaceSkill.id, agentId, installPayload);
1772
- writeSuccess(`\nāœ… "${skillDetails.displayName}" v${selectedVersion.version} has been installed successfully!`);
1773
- writeInfo(`šŸ’” The skill is now available on agent ${agentId}.\n`);
1774
- }
1775
- catch (error) {
1776
- console.error(`\nāŒ Error installing skill: ${error.message}\n`);
1777
- }
1778
- }
1779
- /**
1780
- * Update an installed marketplace skill (version and/or env vars)
1781
- */
1782
- async function updateInstalledSkill(marketplaceApi, config, apiKey) {
1783
- try {
1784
- const agentId = config.agent?.agentId;
1785
- if (!agentId) {
1786
- console.error('\nāŒ No agent ID found in configuration.\n');
1787
- return;
1788
- }
1789
- // 1. Fetch installed skills
1790
- writeProgress(`\nšŸ”„ Loading installed marketplace skills...`);
1791
- const installedSkills = await marketplaceApi.getInstalledSkills(agentId);
1792
- if (!installedSkills || installedSkills.length === 0) {
1793
- writeInfo('\nšŸ“¦ No marketplace skills installed on this agent yet.');
1794
- writeInfo("šŸ’” Use 'Install a skill' to get started.\n");
1795
- return;
1796
- }
1797
- // 2. Select which installed skill to update
1798
- const skillAnswer = await safePrompt([
1799
- {
1800
- type: 'list',
1801
- name: 'skill',
1802
- message: 'Which installed skill would you like to update?',
1803
- choices: installedSkills.map((s) => ({
1804
- name: `${s.title || s.name} (currently v${s.activeVersionId || 'unknown'})`,
1805
- value: s,
1806
- })),
1807
- },
1808
- ]);
1809
- if (!skillAnswer)
1810
- return;
1811
- const installedSkill = skillAnswer.skill;
1812
- // 3. Choose what to update
1813
- const updateChoiceAnswer = await safePrompt([
1814
- {
1815
- type: 'list',
1816
- name: 'choice',
1817
- message: 'What would you like to update?',
1818
- choices: [
1819
- { name: 'Upgrade to a different version', value: 'version' },
1820
- { name: 'Update environment variables', value: 'envVars' },
1821
- {
1822
- name: 'Update both version and environment variables',
1823
- value: 'both',
1824
- },
1825
- { name: 'Cancel', value: 'cancel' },
1826
- ],
1827
- },
1828
- ]);
1829
- if (!updateChoiceAnswer || updateChoiceAnswer.choice === 'cancel') {
1830
- return;
1831
- }
1832
- const updateChoice = updateChoiceAnswer.choice;
1833
- let newVersionId = undefined;
1834
- let newEnvVars = undefined;
1835
- // 4. Handle version update
1836
- if (updateChoice === 'version' || updateChoice === 'both') {
1837
- // Fetch skill details to get available versions
1838
- writeProgress(`\nšŸ”„ Loading available versions...`);
1839
- const marketplaceSkillId = installedSkill.marketplaceSkillId;
1840
- if (!marketplaceSkillId) {
1841
- console.error('\nāŒ Skill is missing marketplace skill ID.\n');
1842
- return;
1843
- }
1844
- const versions = await marketplaceApi.getSkillVersions(marketplaceSkillId);
1845
- const publishedVersions = (versions || []).filter((v) => v.published);
1846
- if (publishedVersions.length === 0) {
1847
- writeInfo('\nāŒ No published versions available for this skill.\n');
1848
- return;
1849
- }
1850
- const versionAnswer = await safePrompt([
1851
- {
1852
- type: 'list',
1853
- name: 'version',
1854
- message: 'Select a version to upgrade to:',
1855
- choices: publishedVersions
1856
- .sort((a, b) => compareVersions(b.version, a.version))
1857
- .map((v) => ({
1858
- name: `v${v.version}${v.id === installedSkill.marketplaceInstallMetadata?.installedVersionId ? ' (current)' : ''} - ${new Date(v.createdAt).toLocaleDateString()}${v.changelog ? ` - ${v.changelog}` : ''}`,
1859
- value: v,
1860
- })),
1861
- },
1862
- ]);
1863
- if (!versionAnswer)
1864
- return;
1865
- newVersionId = versionAnswer.version.id;
1866
- }
1867
- // 5. Handle environment variables update
1868
- if (updateChoice === 'envVars' || updateChoice === 'both') {
1869
- // Fetch current agent environment variables
1870
- let currentAgentEnvVars = {};
1871
- try {
1872
- const developerApi = new DeveloperApi(BASE_URLS.API, apiKey, agentId);
1873
- const response = await developerApi.getEnvironmentVariables();
1874
- if (response.success && response.data?.data) {
1875
- currentAgentEnvVars = response.data.data;
1876
- }
1877
- }
1878
- catch (e) {
1879
- // Silent fail, just don't show current values
1880
- }
1881
- const marketplaceSkillId = installedSkill.marketplaceSkillId;
1882
- if (!marketplaceSkillId) {
1883
- console.error('\nāŒ Skill is missing marketplace skill ID.\n');
1884
- return;
1885
- }
1886
- const skillDetails = await marketplaceApi.getSkillById(marketplaceSkillId);
1887
- // Determine which version's env vars to use
1888
- let targetVersion;
1889
- if (newVersionId) {
1890
- // Use the new version selected
1891
- targetVersion = skillDetails.versions?.find((v) => v.id === newVersionId);
1892
- }
1893
- else if (installedSkill.marketplaceInstallMetadata?.installedVersionId) {
1894
- // Use the currently installed version
1895
- targetVersion = skillDetails.versions?.find((v) => v.id === installedSkill.marketplaceInstallMetadata.installedVersionId);
1896
- }
1897
- // Fallback to latest version if not found (shouldn't happen usually)
1898
- if (!targetVersion && skillDetails.versions && skillDetails.versions.length > 0) {
1899
- targetVersion = skillDetails.versions.sort((a, b) => compareVersions(b.version, a.version))[0];
1900
- }
1901
- const envVarsMetadata = targetVersion?.envVarsMetadata || {};
1902
- if (Object.keys(envVarsMetadata).length === 0) {
1903
- writeInfo('\nšŸ“ This version has no environment variables to configure.\n');
1904
- if (updateChoice === 'envVars') {
1905
- return; // Nothing to update
1906
- }
1907
- }
1908
- else {
1909
- writeInfo('\nšŸ“ Update environment variables:\n');
1910
- const updatedEnvVars = {};
1911
- for (const [key, meta] of Object.entries(envVarsMetadata)) {
1912
- const varMeta = meta;
1913
- const isRequired = varMeta.required;
1914
- const description = varMeta.description || 'No description';
1915
- const example = varMeta.example ? ` (e.g., ${varMeta.example})` : '';
1916
- const currentValue = currentAgentEnvVars[key] || '';
1917
- console.log(`\n${key}${isRequired ? ' (required)' : ' (optional)'}`);
1918
- console.log(` ${description}${example}`);
1919
- if (currentValue) {
1920
- const maskedValue = currentValue.length > 4
1921
- ? currentValue.substring(0, 4) + '*'.repeat(Math.min(currentValue.length - 4, 20))
1922
- : '*'.repeat(currentValue.length);
1923
- console.log(` Current value: ${maskedValue}`);
1924
- }
1925
- const valueAnswer = await safePrompt([
1926
- {
1927
- type: 'input',
1928
- name: 'value',
1929
- message: `Enter new value for ${key} (leave empty to keep current):`,
1930
- default: currentValue,
1931
- validate: (input) => {
1932
- if (isRequired && !input.trim() && !currentValue) {
1933
- return `${key} is required`;
1934
- }
1935
- return true;
1936
- },
1937
- },
1938
- ]);
1939
- if (valueAnswer === null) {
1940
- writeInfo('\nāŒ Update cancelled.\n');
1941
- return;
1942
- }
1943
- if (valueAnswer.value && valueAnswer.value.trim() && valueAnswer.value !== currentValue) {
1944
- updatedEnvVars[key] = valueAnswer.value.trim();
1945
- }
1946
- }
1947
- newEnvVars = updatedEnvVars;
1948
- }
1949
- }
1950
- // 6. Confirm update
1951
- console.log('\nšŸ“‹ Update Summary:');
1952
- console.log(` Skill: ${installedSkill.title || installedSkill.name}`);
1953
- console.log(` Agent: ${agentId}`);
1954
- if (newVersionId) {
1955
- console.log(` New version will be applied`);
1956
- }
1957
- if (newEnvVars && Object.keys(newEnvVars).length > 0) {
1958
- console.log(` Environment variables: ${Object.keys(newEnvVars).length} to update`);
1959
- }
1960
- const confirmAnswer = await safePrompt([
1961
- {
1962
- type: 'confirm',
1963
- name: 'confirm',
1964
- message: 'Proceed with update?',
1965
- default: true,
1966
- },
1967
- ]);
1968
- if (!confirmAnswer || !confirmAnswer.confirm) {
1969
- writeInfo('\nāŒ Update cancelled.\n');
1970
- return;
1971
- }
1972
- // 7. Update the skill
1973
- writeProgress('\nšŸ”„ Updating installed skill...');
1974
- const updatePayload = {};
1975
- if (newVersionId) {
1976
- updatePayload.versionId = newVersionId;
1977
- }
1978
- if (newEnvVars) {
1979
- updatePayload.envVars = newEnvVars;
1980
- }
1981
- if (!installedSkill.marketplaceSkillId) {
1982
- console.error('\nāŒ Skill is missing marketplace skill ID.\n');
1983
- return;
1984
- }
1985
- await marketplaceApi.updateInstallation(installedSkill.marketplaceSkillId, agentId, updatePayload);
1986
- writeSuccess(`\nāœ… "${installedSkill.title || installedSkill.name}" has been updated successfully!`);
1987
- writeInfo(`šŸ’” The changes are now active on agent ${agentId}.\n`);
1988
- }
1989
- catch (error) {
1990
- console.error(`\nāŒ Error updating installed skill: ${error.message}\n`);
1991
- }
1992
- }
1993
- /**
1994
- * Uninstall a marketplace skill from the agent
1995
- */
1996
- async function uninstallMarketplaceSkill(marketplaceApi, config) {
1997
- try {
1998
- const agentId = config.agent?.agentId;
1999
- if (!agentId) {
2000
- console.error('\nāŒ No agent ID found in configuration.\n');
2001
- return;
2002
- }
2003
- // 1. Fetch installed skills
2004
- writeProgress(`\nšŸ”„ Loading installed marketplace skills...`);
2005
- const installedSkills = await marketplaceApi.getInstalledSkills(agentId);
2006
- if (!installedSkills || installedSkills.length === 0) {
2007
- writeInfo('\nšŸ“¦ No marketplace skills installed on this agent yet.');
2008
- writeInfo("šŸ’” Use 'Install a skill' to get started.\n");
2009
- return;
2010
- }
2011
- // 2. Select which installed skill to uninstall
2012
- const skillAnswer = await safePrompt([
2013
- {
2014
- type: 'list',
2015
- name: 'skill',
2016
- message: 'Which skill would you like to uninstall?',
2017
- choices: installedSkills.map((s) => ({
2018
- name: `${s.title || s.name} (v${s.activeVersionId || 'unknown'})`,
2019
- value: s,
2020
- })),
2021
- },
2022
- ]);
2023
- if (!skillAnswer)
2024
- return;
2025
- const installedSkill = skillAnswer.skill;
2026
- // 3. Confirm uninstallation
2027
- const confirmAnswer = await safePrompt([
2028
- {
2029
- type: 'confirm',
2030
- name: 'confirm',
2031
- message: `āš ļø Are you sure you want to uninstall "${installedSkill.title || installedSkill.name}"?`,
2032
- default: false,
2033
- },
2034
- ]);
2035
- if (!confirmAnswer || !confirmAnswer.confirm) {
2036
- writeInfo('\nāŒ Uninstall cancelled.\n');
2037
- return;
2038
- }
2039
- if (!installedSkill.marketplaceSkillId) {
2040
- console.error('\nāŒ Skill is missing marketplace skill ID.\n');
2041
- return;
2042
- }
2043
- // 4. Uninstall the skill
2044
- writeProgress('\nšŸ”„ Uninstalling skill...');
2045
- await marketplaceApi.uninstallSkill(installedSkill.marketplaceSkillId, agentId);
2046
- writeSuccess(`\nāœ… "${installedSkill.title || installedSkill.name}" has been uninstalled successfully!`);
2047
- writeInfo(`šŸ’” The skill has been removed from agent ${agentId}.\n`);
2048
- }
2049
- catch (error) {
2050
- console.error(`\nāŒ Error uninstalling skill: ${error.message}\n`);
2051
- }
2052
- }
2053
- /**
2054
- * List all installed marketplace skills on the agent
2055
- */
2056
- async function listInstalledSkills(marketplaceApi, config) {
2057
- try {
2058
- const agentId = config.agent?.agentId;
2059
- if (!agentId) {
2060
- console.error('\nāŒ No agent ID found in configuration.\n');
2061
- return;
2062
- }
2063
- writeProgress('\nšŸ”„ Loading installed marketplace skills...\n');
2064
- const installedSkills = await marketplaceApi.getInstalledSkills(agentId);
2065
- if (!installedSkills || installedSkills.length === 0) {
2066
- writeInfo('\nšŸ“¦ No marketplace skills installed on this agent yet.');
2067
- writeInfo("šŸ’” Use 'Install a skill' to browse and install skills.\n");
2068
- return;
2069
- }
2070
- // Display summary
2071
- console.log(`\nšŸ“Š You have ${installedSkills.length} marketplace skill${installedSkills.length === 1 ? '' : 's'} installed:\n`);
2072
- // Display each installed skill
2073
- for (const skill of installedSkills) {
2074
- console.log(`šŸ“¦ ${skill.title || skill.name}`);
2075
- if (skill.marketplaceSkillId) {
2076
- console.log(` Marketplace ID: ${skill.marketplaceSkillId}`);
2077
- }
2078
- if (skill.activeVersionId) {
2079
- console.log(` Version: v${skill.activeVersionId}`);
2080
- }
2081
- if (skill.description) {
2082
- console.log(` Description: ${skill.description}`);
2083
- }
2084
- if (skill.marketplaceInstallMetadata?.installedAt) {
2085
- console.log(` Installed: ${new Date(skill.marketplaceInstallMetadata.installedAt).toLocaleDateString()}`);
2086
- }
2087
- if (skill.marketplaceInstallMetadata?.installedBy) {
2088
- console.log(` Installed By: ${skill.marketplaceInstallMetadata.installedBy}`);
2089
- }
2090
- console.log(''); // Empty line between skills
2091
- }
2092
- // Prompt to continue
2093
- await safePrompt([
2094
- {
2095
- type: 'input',
2096
- name: 'continue',
2097
- message: 'Press Enter to continue...',
2098
- },
2099
- ]);
2100
- }
2101
- catch (error) {
2102
- console.error(`\nāŒ Error loading installed skills: ${error.message}\n`);
2103
- }
2104
- }
2105
- //# sourceMappingURL=marketplace.js.map