lua-cli 3.13.0 → 3.14.1
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/skills.d.ts +18 -0
- package/dist/interfaces/skills.d.ts.map +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 +72 -22
- 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 +47 -0
- package/dist/utils/artifact-loader.d.ts.map +1 -1
- package/dist/utils/artifact-loader.js +98 -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,10 +2,10 @@
|
|
|
2
2
|
* Channels Command
|
|
3
3
|
* Manages agent communication channels (list, create)
|
|
4
4
|
*/
|
|
5
|
-
import inquirer from
|
|
5
|
+
import inquirer from 'inquirer';
|
|
6
6
|
import open from 'open';
|
|
7
|
-
import { withErrorHandling, writeSuccess, writeInfo, clearPromptLines, writeProgress } from
|
|
8
|
-
import { initializeCommand } from
|
|
7
|
+
import { withErrorHandling, writeSuccess, writeInfo, clearPromptLines, writeProgress } from '../utils/cli.js';
|
|
8
|
+
import { initializeCommand } from '../utils/command-utils.js';
|
|
9
9
|
import AgentApi from '../api/agent.api.service.js';
|
|
10
10
|
import { BASE_URLS } from '../config/constants.js';
|
|
11
11
|
import { trackEvent } from '../services/analytics.js';
|
|
@@ -33,7 +33,7 @@ export async function channelsCommand(action) {
|
|
|
33
33
|
await channelsInteractive(agentApi, agentId, apiKey, config);
|
|
34
34
|
}
|
|
35
35
|
trackEvent('cli_channels_action', { action: action || 'interactive', non_interactive: !!action });
|
|
36
|
-
},
|
|
36
|
+
}, 'channels management');
|
|
37
37
|
}
|
|
38
38
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
39
39
|
// Shared Core Functions
|
|
@@ -54,12 +54,12 @@ async function fetchChannelsCore(agentApi, agentId) {
|
|
|
54
54
|
*/
|
|
55
55
|
function getChannelIcon(type) {
|
|
56
56
|
const icons = {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
whatsapp: '📱',
|
|
58
|
+
facebook: '💬',
|
|
59
|
+
instagram: '📸',
|
|
60
|
+
slack: '💼',
|
|
61
|
+
email: '📧',
|
|
62
|
+
webchat: '💻',
|
|
63
63
|
};
|
|
64
64
|
return icons[type] || '📡';
|
|
65
65
|
}
|
|
@@ -86,11 +86,11 @@ function getChannelLabel(channel) {
|
|
|
86
86
|
* Displays all channels (non-interactive).
|
|
87
87
|
*/
|
|
88
88
|
function displayChannelsCore(channels) {
|
|
89
|
-
console.log(
|
|
90
|
-
console.log(
|
|
91
|
-
console.log(
|
|
89
|
+
console.log('\n' + '='.repeat(60));
|
|
90
|
+
console.log('📡 Agent Channels');
|
|
91
|
+
console.log('='.repeat(60) + '\n');
|
|
92
92
|
if (channels.length === 0) {
|
|
93
|
-
console.log(
|
|
93
|
+
console.log('ℹ️ No channels configured for this agent.');
|
|
94
94
|
console.log("💡 Use 'lua channels' (interactive) to add channels.\n");
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
@@ -104,7 +104,7 @@ function displayChannelsCore(channels) {
|
|
|
104
104
|
console.log(` Created: ${created}`);
|
|
105
105
|
console.log();
|
|
106
106
|
});
|
|
107
|
-
console.log(
|
|
107
|
+
console.log('='.repeat(60));
|
|
108
108
|
console.log(`Total: ${channels.length} channel(s)`);
|
|
109
109
|
}
|
|
110
110
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -115,7 +115,7 @@ async function executeNonInteractive(agentApi, agentId, action) {
|
|
|
115
115
|
writeInfo(`📡 Fetching channels for agent: ${agentId}...`);
|
|
116
116
|
const channels = await fetchChannelsCore(agentApi, agentId);
|
|
117
117
|
if (!channels)
|
|
118
|
-
throw new Error(
|
|
118
|
+
throw new Error('Operation failed');
|
|
119
119
|
displayChannelsCore(channels);
|
|
120
120
|
}
|
|
121
121
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -124,25 +124,25 @@ async function executeNonInteractive(agentApi, agentId, action) {
|
|
|
124
124
|
async function channelsInteractive(agentApi, agentId, apiKey, config) {
|
|
125
125
|
const { operation } = await inquirer.prompt([
|
|
126
126
|
{
|
|
127
|
-
type:
|
|
128
|
-
name:
|
|
129
|
-
message:
|
|
127
|
+
type: 'list',
|
|
128
|
+
name: 'operation',
|
|
129
|
+
message: 'What would you like to do?',
|
|
130
130
|
choices: [
|
|
131
|
-
{ name:
|
|
132
|
-
{ name:
|
|
133
|
-
{ name:
|
|
134
|
-
]
|
|
135
|
-
}
|
|
131
|
+
{ name: '📋 List channels', value: 'list' },
|
|
132
|
+
{ name: '🔗 Link new channel', value: 'create' },
|
|
133
|
+
{ name: '🌐 Link on admin dashboard', value: 'admin' },
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
136
|
]);
|
|
137
137
|
clearPromptLines(2);
|
|
138
138
|
trackEvent('cli_channels_interactive_action', { operation });
|
|
139
|
-
if (operation ===
|
|
139
|
+
if (operation === 'list') {
|
|
140
140
|
await listChannelsInteractive(agentApi, agentId, config);
|
|
141
141
|
}
|
|
142
|
-
else if (operation ===
|
|
142
|
+
else if (operation === 'create') {
|
|
143
143
|
await createChannel(agentApi, agentId);
|
|
144
144
|
}
|
|
145
|
-
else if (operation ===
|
|
145
|
+
else if (operation === 'admin') {
|
|
146
146
|
await openAdminDashboard(apiKey, config);
|
|
147
147
|
}
|
|
148
148
|
}
|
|
@@ -173,10 +173,10 @@ async function listChannelsInteractive(agentApi, agentId, config) {
|
|
|
173
173
|
writeInfo(`📡 Fetching channels for agent: ${agentId}...`);
|
|
174
174
|
const channels = await fetchChannelsCore(agentApi, agentId);
|
|
175
175
|
if (!channels)
|
|
176
|
-
throw new Error(
|
|
176
|
+
throw new Error('Operation failed');
|
|
177
177
|
writeSuccess(`✅ Found ${channels.length} channel(s)\n`);
|
|
178
178
|
if (channels.length === 0) {
|
|
179
|
-
writeInfo(
|
|
179
|
+
writeInfo('No channels configured for this agent.');
|
|
180
180
|
writeInfo("\n💡 Use the 'Create new channel' option to add channels.\n");
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
@@ -185,20 +185,20 @@ async function listChannelsInteractive(agentApi, agentId, config) {
|
|
|
185
185
|
const label = getChannelLabel(channel);
|
|
186
186
|
return {
|
|
187
187
|
name: `${icon} ${channel.type.toUpperCase()} - ${label}`,
|
|
188
|
-
value: index
|
|
188
|
+
value: index,
|
|
189
189
|
};
|
|
190
190
|
});
|
|
191
191
|
channelChoices.push({
|
|
192
192
|
name: '← Back to main menu',
|
|
193
|
-
value: -1
|
|
193
|
+
value: -1,
|
|
194
194
|
});
|
|
195
195
|
const { selectedIndex } = await inquirer.prompt([
|
|
196
196
|
{
|
|
197
|
-
type:
|
|
198
|
-
name:
|
|
199
|
-
message:
|
|
200
|
-
choices: channelChoices
|
|
201
|
-
}
|
|
197
|
+
type: 'list',
|
|
198
|
+
name: 'selectedIndex',
|
|
199
|
+
message: 'Select a channel to view details:',
|
|
200
|
+
choices: channelChoices,
|
|
201
|
+
},
|
|
202
202
|
]);
|
|
203
203
|
if (selectedIndex === -1) {
|
|
204
204
|
return;
|
|
@@ -365,34 +365,34 @@ function displayEmailDetails(channel) {
|
|
|
365
365
|
async function createChannel(agentApi, agentId) {
|
|
366
366
|
const { channelType } = await inquirer.prompt([
|
|
367
367
|
{
|
|
368
|
-
type:
|
|
369
|
-
name:
|
|
370
|
-
message:
|
|
368
|
+
type: 'list',
|
|
369
|
+
name: 'channelType',
|
|
370
|
+
message: 'Select channel type:',
|
|
371
371
|
choices: [
|
|
372
|
-
{ name:
|
|
373
|
-
{ name:
|
|
374
|
-
{ name:
|
|
375
|
-
{ name:
|
|
376
|
-
{ name:
|
|
377
|
-
]
|
|
378
|
-
}
|
|
372
|
+
{ name: '📱 WhatsApp', value: 'whatsapp' },
|
|
373
|
+
{ name: '💬 Facebook Messenger', value: 'facebook' },
|
|
374
|
+
{ name: '📧 Email', value: 'email' },
|
|
375
|
+
{ name: '🔒 Slack (Private)', value: 'slack-private' },
|
|
376
|
+
{ name: '🌐 Slack (Public)', value: 'slack-public' },
|
|
377
|
+
],
|
|
378
|
+
},
|
|
379
379
|
]);
|
|
380
380
|
clearPromptLines(2);
|
|
381
381
|
trackEvent('cli_channel_created', { channel_type: channelType });
|
|
382
382
|
switch (channelType) {
|
|
383
|
-
case
|
|
383
|
+
case 'whatsapp':
|
|
384
384
|
await createWhatsAppChannel(agentApi, agentId);
|
|
385
385
|
break;
|
|
386
|
-
case
|
|
386
|
+
case 'facebook':
|
|
387
387
|
await createFacebookChannel(agentApi, agentId);
|
|
388
388
|
break;
|
|
389
|
-
case
|
|
389
|
+
case 'email':
|
|
390
390
|
await createEmailChannel(agentApi, agentId);
|
|
391
391
|
break;
|
|
392
|
-
case
|
|
392
|
+
case 'slack-private':
|
|
393
393
|
await createSlackPrivateChannel(agentApi, agentId);
|
|
394
394
|
break;
|
|
395
|
-
case
|
|
395
|
+
case 'slack-public':
|
|
396
396
|
await createSlackPublicChannel(agentApi, agentId);
|
|
397
397
|
break;
|
|
398
398
|
}
|
|
@@ -401,44 +401,44 @@ async function createChannel(agentApi, agentId) {
|
|
|
401
401
|
* Creates a WhatsApp channel
|
|
402
402
|
*/
|
|
403
403
|
async function createWhatsAppChannel(agentApi, agentId) {
|
|
404
|
-
writeInfo(
|
|
404
|
+
writeInfo('📱 Creating WhatsApp Channel\n');
|
|
405
405
|
const answers = await inquirer.prompt([
|
|
406
406
|
{
|
|
407
|
-
type:
|
|
408
|
-
name:
|
|
409
|
-
message:
|
|
407
|
+
type: 'input',
|
|
408
|
+
name: 'phoneNumberId',
|
|
409
|
+
message: 'Enter phone number ID:',
|
|
410
410
|
validate: (input) => {
|
|
411
|
-
return input.trim().length > 0 ||
|
|
412
|
-
}
|
|
411
|
+
return input.trim().length > 0 || 'Phone number ID is required';
|
|
412
|
+
},
|
|
413
413
|
},
|
|
414
414
|
{
|
|
415
|
-
type:
|
|
416
|
-
name:
|
|
417
|
-
message:
|
|
415
|
+
type: 'input',
|
|
416
|
+
name: 'wabaId',
|
|
417
|
+
message: 'Enter WhatsApp Business Account ID (WABA ID):',
|
|
418
418
|
validate: (input) => {
|
|
419
|
-
return input.trim().length > 0 ||
|
|
420
|
-
}
|
|
419
|
+
return input.trim().length > 0 || 'WABA ID is required';
|
|
420
|
+
},
|
|
421
421
|
},
|
|
422
422
|
{
|
|
423
|
-
type:
|
|
424
|
-
name:
|
|
425
|
-
message:
|
|
426
|
-
mask:
|
|
423
|
+
type: 'password',
|
|
424
|
+
name: 'accessToken',
|
|
425
|
+
message: 'Enter access token:',
|
|
426
|
+
mask: '*',
|
|
427
427
|
validate: (input) => {
|
|
428
|
-
return input.trim().length > 0 ||
|
|
429
|
-
}
|
|
430
|
-
}
|
|
428
|
+
return input.trim().length > 0 || 'Access token is required';
|
|
429
|
+
},
|
|
430
|
+
},
|
|
431
431
|
]);
|
|
432
432
|
const channelData = {
|
|
433
|
-
type:
|
|
433
|
+
type: 'whatsapp',
|
|
434
434
|
whatsapp: {
|
|
435
435
|
phoneNumberId: answers.phoneNumberId.trim(),
|
|
436
436
|
wabaId: answers.wabaId.trim(),
|
|
437
|
-
accessToken: answers.accessToken.trim()
|
|
437
|
+
accessToken: answers.accessToken.trim(),
|
|
438
438
|
},
|
|
439
|
-
isManual: true
|
|
439
|
+
isManual: true,
|
|
440
440
|
};
|
|
441
|
-
writeInfo(
|
|
441
|
+
writeInfo('\n📡 Creating WhatsApp channel...');
|
|
442
442
|
const response = await agentApi.createWhatsAppChannel(agentId, channelData);
|
|
443
443
|
if (!response.success) {
|
|
444
444
|
const error = response.error;
|
|
@@ -453,10 +453,10 @@ async function createWhatsAppChannel(agentApi, agentId) {
|
|
|
453
453
|
console.error(` ${error.error}\n`);
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
-
throw new Error(
|
|
456
|
+
throw new Error('Operation failed');
|
|
457
457
|
}
|
|
458
458
|
const data = response.data;
|
|
459
|
-
writeSuccess(
|
|
459
|
+
writeSuccess('\n✅ WhatsApp channel created successfully!\n');
|
|
460
460
|
writeInfo(`📞 Phone Number: ${data.whatsapp.number}`);
|
|
461
461
|
writeInfo(`🆔 Identifier: ${data.identifier}`);
|
|
462
462
|
writeInfo(`✅ Status: ${data.whatsapp.metadata.status}`);
|
|
@@ -466,34 +466,34 @@ async function createWhatsAppChannel(agentApi, agentId) {
|
|
|
466
466
|
* Creates a Facebook Messenger channel
|
|
467
467
|
*/
|
|
468
468
|
async function createFacebookChannel(agentApi, agentId) {
|
|
469
|
-
writeInfo(
|
|
469
|
+
writeInfo('💬 Creating Facebook Messenger Channel\n');
|
|
470
470
|
const answers = await inquirer.prompt([
|
|
471
471
|
{
|
|
472
|
-
type:
|
|
473
|
-
name:
|
|
474
|
-
message:
|
|
475
|
-
mask:
|
|
472
|
+
type: 'password',
|
|
473
|
+
name: 'accessToken',
|
|
474
|
+
message: 'Enter Facebook page access token:',
|
|
475
|
+
mask: '*',
|
|
476
476
|
validate: (input) => {
|
|
477
|
-
return input.trim().length > 0 ||
|
|
478
|
-
}
|
|
477
|
+
return input.trim().length > 0 || 'Access token is required';
|
|
478
|
+
},
|
|
479
479
|
},
|
|
480
480
|
{
|
|
481
|
-
type:
|
|
482
|
-
name:
|
|
483
|
-
message:
|
|
481
|
+
type: 'input',
|
|
482
|
+
name: 'pageId',
|
|
483
|
+
message: 'Enter Facebook page ID:',
|
|
484
484
|
validate: (input) => {
|
|
485
|
-
return input.trim().length > 0 ||
|
|
486
|
-
}
|
|
487
|
-
}
|
|
485
|
+
return input.trim().length > 0 || 'Page ID is required';
|
|
486
|
+
},
|
|
487
|
+
},
|
|
488
488
|
]);
|
|
489
489
|
const channelData = {
|
|
490
|
-
type:
|
|
490
|
+
type: 'facebook',
|
|
491
491
|
facebook: {
|
|
492
492
|
accessToken: answers.accessToken.trim(),
|
|
493
|
-
pageId: answers.pageId.trim()
|
|
494
|
-
}
|
|
493
|
+
pageId: answers.pageId.trim(),
|
|
494
|
+
},
|
|
495
495
|
};
|
|
496
|
-
writeInfo(
|
|
496
|
+
writeInfo('\n📡 Creating Facebook channel...');
|
|
497
497
|
const response = await agentApi.createFacebookChannel(agentId, channelData);
|
|
498
498
|
if (!response.success) {
|
|
499
499
|
const error = response.error;
|
|
@@ -508,10 +508,10 @@ async function createFacebookChannel(agentApi, agentId) {
|
|
|
508
508
|
console.error(` ${error.error}\n`);
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
|
-
throw new Error(
|
|
511
|
+
throw new Error('Operation failed');
|
|
512
512
|
}
|
|
513
513
|
const data = response.data;
|
|
514
|
-
writeSuccess(
|
|
514
|
+
writeSuccess('\n✅ Facebook channel created successfully!\n');
|
|
515
515
|
writeInfo(`📄 Page Name: ${data.facebook.name}`);
|
|
516
516
|
writeInfo(`🆔 Identifier: ${data.identifier}`);
|
|
517
517
|
writeInfo(`📋 Category: ${data.facebook.category}`);
|
|
@@ -521,57 +521,57 @@ async function createFacebookChannel(agentApi, agentId) {
|
|
|
521
521
|
* Creates an Email channel
|
|
522
522
|
*/
|
|
523
523
|
async function createEmailChannel(agentApi, agentId) {
|
|
524
|
-
writeInfo(
|
|
524
|
+
writeInfo('📧 Creating Email Channel\n');
|
|
525
525
|
const { mode } = await inquirer.prompt([
|
|
526
526
|
{
|
|
527
|
-
type:
|
|
528
|
-
name:
|
|
529
|
-
message:
|
|
527
|
+
type: 'list',
|
|
528
|
+
name: 'mode',
|
|
529
|
+
message: 'Select email channel mode:',
|
|
530
530
|
choices: [
|
|
531
|
-
{ name:
|
|
532
|
-
{ name:
|
|
533
|
-
]
|
|
534
|
-
}
|
|
531
|
+
{ name: '📬 Generate new inbox (Lua creates an email address for you)', value: 'generated' },
|
|
532
|
+
{ name: '📧 Use existing email (forward from your own address)', value: 'existing' },
|
|
533
|
+
],
|
|
534
|
+
},
|
|
535
535
|
]);
|
|
536
536
|
clearPromptLines(2);
|
|
537
537
|
const { displayName } = await inquirer.prompt([
|
|
538
538
|
{
|
|
539
|
-
type:
|
|
540
|
-
name:
|
|
541
|
-
message:
|
|
539
|
+
type: 'input',
|
|
540
|
+
name: 'displayName',
|
|
541
|
+
message: 'Enter display name (shown in email header):',
|
|
542
542
|
validate: (input) => {
|
|
543
|
-
return input.trim().length > 0 ||
|
|
544
|
-
}
|
|
545
|
-
}
|
|
543
|
+
return input.trim().length > 0 || 'Display name is required';
|
|
544
|
+
},
|
|
545
|
+
},
|
|
546
546
|
]);
|
|
547
547
|
const channelData = {
|
|
548
|
-
type:
|
|
548
|
+
type: 'email',
|
|
549
549
|
email: {
|
|
550
550
|
mode: mode,
|
|
551
551
|
displayName: displayName.trim(),
|
|
552
|
-
}
|
|
552
|
+
},
|
|
553
553
|
};
|
|
554
|
-
if (mode ===
|
|
554
|
+
if (mode === 'existing') {
|
|
555
555
|
const { email } = await inquirer.prompt([
|
|
556
556
|
{
|
|
557
|
-
type:
|
|
558
|
-
name:
|
|
559
|
-
message:
|
|
557
|
+
type: 'input',
|
|
558
|
+
name: 'email',
|
|
559
|
+
message: 'Enter sender email address:',
|
|
560
560
|
validate: (input) => {
|
|
561
561
|
if (input.trim().length === 0) {
|
|
562
|
-
return
|
|
562
|
+
return 'Email address is required';
|
|
563
563
|
}
|
|
564
564
|
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
565
565
|
if (!emailRegex.test(input.trim())) {
|
|
566
|
-
return
|
|
566
|
+
return 'Please enter a valid email address';
|
|
567
567
|
}
|
|
568
568
|
return true;
|
|
569
|
-
}
|
|
570
|
-
}
|
|
569
|
+
},
|
|
570
|
+
},
|
|
571
571
|
]);
|
|
572
572
|
channelData.email.email = email.trim();
|
|
573
573
|
}
|
|
574
|
-
writeInfo(
|
|
574
|
+
writeInfo('\n📡 Creating Email channel...');
|
|
575
575
|
const response = await agentApi.createEmailChannel(agentId, channelData);
|
|
576
576
|
if (!response.success) {
|
|
577
577
|
const error = response.error;
|
|
@@ -586,12 +586,12 @@ async function createEmailChannel(agentApi, agentId) {
|
|
|
586
586
|
console.error(` ${error.error}\n`);
|
|
587
587
|
}
|
|
588
588
|
}
|
|
589
|
-
throw new Error(
|
|
589
|
+
throw new Error('Operation failed');
|
|
590
590
|
}
|
|
591
591
|
const data = response.data;
|
|
592
|
-
writeSuccess(
|
|
592
|
+
writeSuccess('\n✅ Email channel created successfully!\n');
|
|
593
593
|
writeInfo(`📧 Display Name: ${displayName}`);
|
|
594
|
-
if (mode ===
|
|
594
|
+
if (mode === 'generated') {
|
|
595
595
|
const generatedData = data;
|
|
596
596
|
writeInfo(`📬 Email Address: ${generatedData.emailAddress}\n`);
|
|
597
597
|
writeInfo(`${'─'.repeat(60)}`);
|
|
@@ -623,32 +623,32 @@ async function createEmailChannel(agentApi, agentId) {
|
|
|
623
623
|
* Creates a private Slack channel
|
|
624
624
|
*/
|
|
625
625
|
async function createSlackPrivateChannel(agentApi, agentId) {
|
|
626
|
-
writeInfo(
|
|
626
|
+
writeInfo('🔒 Creating Private Slack Channel\n');
|
|
627
627
|
const answers = await inquirer.prompt([
|
|
628
628
|
{
|
|
629
|
-
type:
|
|
630
|
-
name:
|
|
631
|
-
message:
|
|
632
|
-
mask:
|
|
629
|
+
type: 'password',
|
|
630
|
+
name: 'accessToken',
|
|
631
|
+
message: 'Enter Slack bot access token (xoxb-...):',
|
|
632
|
+
mask: '*',
|
|
633
633
|
validate: (input) => {
|
|
634
634
|
if (input.trim().length === 0) {
|
|
635
|
-
return
|
|
635
|
+
return 'Access token is required';
|
|
636
636
|
}
|
|
637
|
-
if (!input.trim().startsWith(
|
|
637
|
+
if (!input.trim().startsWith('xoxb-')) {
|
|
638
638
|
return "Bot token should start with 'xoxb-'";
|
|
639
639
|
}
|
|
640
640
|
return true;
|
|
641
|
-
}
|
|
642
|
-
}
|
|
641
|
+
},
|
|
642
|
+
},
|
|
643
643
|
]);
|
|
644
644
|
const channelData = {
|
|
645
|
-
type:
|
|
645
|
+
type: 'slack',
|
|
646
646
|
slack: {
|
|
647
|
-
type:
|
|
648
|
-
accessToken: answers.accessToken.trim()
|
|
649
|
-
}
|
|
647
|
+
type: 'private',
|
|
648
|
+
accessToken: answers.accessToken.trim(),
|
|
649
|
+
},
|
|
650
650
|
};
|
|
651
|
-
writeInfo(
|
|
651
|
+
writeInfo('\n📡 Creating Slack private channel...');
|
|
652
652
|
const response = await agentApi.createSlackChannel(agentId, channelData);
|
|
653
653
|
if (!response.success) {
|
|
654
654
|
const error = response.error;
|
|
@@ -663,11 +663,11 @@ async function createSlackPrivateChannel(agentApi, agentId) {
|
|
|
663
663
|
console.error(` ${error.error}\n`);
|
|
664
664
|
}
|
|
665
665
|
}
|
|
666
|
-
throw new Error(
|
|
666
|
+
throw new Error('Operation failed');
|
|
667
667
|
}
|
|
668
668
|
const data = response.data;
|
|
669
669
|
if ('slack' in data && 'botName' in data.slack) {
|
|
670
|
-
writeSuccess(
|
|
670
|
+
writeSuccess('\n✅ Slack private channel created successfully!\n');
|
|
671
671
|
writeInfo(`🤖 Bot Name: ${data.slack.botName}`);
|
|
672
672
|
writeInfo(`🏢 Workspace: ${data.slack.url}`);
|
|
673
673
|
writeInfo(`🆔 Bot ID: ${data.slack.botId}`);
|
|
@@ -679,44 +679,44 @@ async function createSlackPrivateChannel(agentApi, agentId) {
|
|
|
679
679
|
* Creates a public Slack channel
|
|
680
680
|
*/
|
|
681
681
|
async function createSlackPublicChannel(agentApi, agentId) {
|
|
682
|
-
writeInfo(
|
|
682
|
+
writeInfo('🌐 Creating Public Slack Channel\n');
|
|
683
683
|
const answers = await inquirer.prompt([
|
|
684
684
|
{
|
|
685
|
-
type:
|
|
686
|
-
name:
|
|
687
|
-
message:
|
|
685
|
+
type: 'input',
|
|
686
|
+
name: 'appId',
|
|
687
|
+
message: 'Enter Slack app ID:',
|
|
688
688
|
validate: (input) => {
|
|
689
|
-
return input.trim().length > 0 ||
|
|
690
|
-
}
|
|
689
|
+
return input.trim().length > 0 || 'App ID is required';
|
|
690
|
+
},
|
|
691
691
|
},
|
|
692
692
|
{
|
|
693
|
-
type:
|
|
694
|
-
name:
|
|
695
|
-
message:
|
|
693
|
+
type: 'input',
|
|
694
|
+
name: 'clientId',
|
|
695
|
+
message: 'Enter Slack client ID:',
|
|
696
696
|
validate: (input) => {
|
|
697
|
-
return input.trim().length > 0 ||
|
|
698
|
-
}
|
|
697
|
+
return input.trim().length > 0 || 'Client ID is required';
|
|
698
|
+
},
|
|
699
699
|
},
|
|
700
700
|
{
|
|
701
|
-
type:
|
|
702
|
-
name:
|
|
703
|
-
message:
|
|
704
|
-
mask:
|
|
701
|
+
type: 'password',
|
|
702
|
+
name: 'clientSecret',
|
|
703
|
+
message: 'Enter Slack client secret:',
|
|
704
|
+
mask: '*',
|
|
705
705
|
validate: (input) => {
|
|
706
|
-
return input.trim().length > 0 ||
|
|
707
|
-
}
|
|
708
|
-
}
|
|
706
|
+
return input.trim().length > 0 || 'Client secret is required';
|
|
707
|
+
},
|
|
708
|
+
},
|
|
709
709
|
]);
|
|
710
710
|
const channelData = {
|
|
711
|
-
type:
|
|
711
|
+
type: 'slack',
|
|
712
712
|
slack: {
|
|
713
|
-
type:
|
|
713
|
+
type: 'public',
|
|
714
714
|
appId: answers.appId.trim(),
|
|
715
715
|
clientId: answers.clientId.trim(),
|
|
716
|
-
clientSecret: answers.clientSecret.trim()
|
|
717
|
-
}
|
|
716
|
+
clientSecret: answers.clientSecret.trim(),
|
|
717
|
+
},
|
|
718
718
|
};
|
|
719
|
-
writeInfo(
|
|
719
|
+
writeInfo('\n📡 Creating Slack public channel...');
|
|
720
720
|
const response = await agentApi.createSlackChannel(agentId, channelData);
|
|
721
721
|
if (!response.success) {
|
|
722
722
|
const error = response.error;
|
|
@@ -731,11 +731,11 @@ async function createSlackPublicChannel(agentApi, agentId) {
|
|
|
731
731
|
console.error(` ${error.error}\n`);
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
|
-
throw new Error(
|
|
734
|
+
throw new Error('Operation failed');
|
|
735
735
|
}
|
|
736
736
|
const data = response.data;
|
|
737
737
|
if ('redirectUri' in data) {
|
|
738
|
-
writeSuccess(
|
|
738
|
+
writeSuccess('\n✅ Slack public channel created successfully!\n');
|
|
739
739
|
writeInfo(`🆔 App ID: ${data.appId}`);
|
|
740
740
|
writeInfo(`🔗 Redirect URI: ${data.redirectUri}`);
|
|
741
741
|
writeInfo(`🔗 Webhook URL: ${data.webhookUrl}\n`);
|