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