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