lua-cli 3.12.2 → 3.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +9 -6
- package/dist/api/logs.api.service.d.ts.map +1 -1
- package/dist/api/logs.api.service.js +12 -11
- 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 +209 -196
- 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.d.ts.map +1 -1
- package/dist/commands/channels.js +165 -174
- package/dist/commands/channels.js.map +1 -1
- package/dist/commands/chat-log-probe.d.ts +59 -0
- package/dist/commands/chat-log-probe.d.ts.map +1 -0
- package/dist/commands/chat-log-probe.js +87 -0
- package/dist/commands/chat-log-probe.js.map +1 -0
- package/dist/commands/chat.d.ts.map +1 -1
- package/dist/commands/chat.js +143 -40
- 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 +7 -0
- package/dist/commands/compile.d.ts.map +1 -1
- package/dist/commands/compile.js +49 -12
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/completion.d.ts.map +1 -1
- package/dist/commands/completion.js +8 -9
- package/dist/commands/completion.js.map +1 -1
- package/dist/commands/configure.js +5 -5
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +132 -35
- 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.d.ts.map +1 -1
- package/dist/commands/devices.js +4 -5
- package/dist/commands/devices.js.map +1 -1
- package/dist/commands/env.d.ts.map +1 -1
- package/dist/commands/env.js +101 -80
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/features.d.ts.map +1 -1
- package/dist/commands/features.js +71 -82
- package/dist/commands/features.js.map +1 -1
- package/dist/commands/governance.d.ts.map +1 -1
- package/dist/commands/governance.js +17 -15
- package/dist/commands/governance.js.map +1 -1
- package/dist/commands/index.d.ts +37 -36
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +37 -36
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +80 -70
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/integrations.d.ts.map +1 -1
- package/dist/commands/integrations.js +373 -341
- package/dist/commands/integrations.js.map +1 -1
- package/dist/commands/jobs.d.ts.map +1 -1
- package/dist/commands/jobs.js +110 -78
- package/dist/commands/jobs.js.map +1 -1
- package/dist/commands/log-tip.d.ts +79 -0
- package/dist/commands/log-tip.d.ts.map +1 -0
- package/dist/commands/log-tip.js +83 -0
- package/dist/commands/log-tip.js.map +1 -0
- package/dist/commands/logs.d.ts.map +1 -1
- package/dist/commands/logs.js +166 -198
- package/dist/commands/logs.js.map +1 -1
- package/dist/commands/marketplace.d.ts.map +1 -1
- package/dist/commands/marketplace.js +381 -427
- package/dist/commands/marketplace.js.map +1 -1
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +54 -56
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/models.d.ts.map +1 -1
- package/dist/commands/models.js +4 -3
- package/dist/commands/models.js.map +1 -1
- package/dist/commands/persona.d.ts.map +1 -1
- package/dist/commands/persona.js +100 -126
- package/dist/commands/persona.js.map +1 -1
- package/dist/commands/postprocessors.d.ts.map +1 -1
- package/dist/commands/postprocessors.js +87 -61
- package/dist/commands/postprocessors.js.map +1 -1
- package/dist/commands/preprocessors.d.ts.map +1 -1
- package/dist/commands/preprocessors.js +87 -61
- package/dist/commands/preprocessors.js.map +1 -1
- package/dist/commands/production.d.ts.map +1 -1
- package/dist/commands/production.js +101 -113
- package/dist/commands/production.js.map +1 -1
- package/dist/commands/push-helpers.d.ts +42 -0
- package/dist/commands/push-helpers.d.ts.map +1 -0
- package/dist/commands/push-helpers.js +48 -0
- package/dist/commands/push-helpers.js.map +1 -0
- package/dist/commands/push.d.ts +2 -0
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +388 -124
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/pushBackup.d.ts.map +1 -1
- package/dist/commands/pushBackup.js +8 -4
- package/dist/commands/pushBackup.js.map +1 -1
- package/dist/commands/resources.d.ts.map +1 -1
- package/dist/commands/resources.js +47 -60
- package/dist/commands/resources.js.map +1 -1
- package/dist/commands/skills.d.ts.map +1 -1
- package/dist/commands/skills.js +117 -89
- package/dist/commands/skills.js.map +1 -1
- package/dist/commands/status.d.ts +14 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +731 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +70 -30
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/telemetry.d.ts.map +1 -1
- package/dist/commands/telemetry.js +4 -0
- package/dist/commands/telemetry.js.map +1 -1
- package/dist/commands/test-output.helpers.d.ts +24 -0
- package/dist/commands/test-output.helpers.d.ts.map +1 -0
- package/dist/commands/test-output.helpers.js +62 -0
- package/dist/commands/test-output.helpers.js.map +1 -0
- package/dist/commands/test.d.ts.map +1 -1
- package/dist/commands/test.js +291 -121
- 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 +94 -87
- package/dist/commands/webhooks.js.map +1 -1
- package/dist/compiler/agent-traverser.d.ts +50 -14
- package/dist/compiler/agent-traverser.d.ts.map +1 -1
- package/dist/compiler/agent-traverser.js +189 -86
- 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 +32 -0
- package/dist/compiler/compiler.d.ts.map +1 -1
- package/dist/compiler/compiler.js +154 -28
- package/dist/compiler/compiler.js.map +1 -1
- package/dist/compiler/index.d.ts +3 -3
- package/dist/compiler/index.d.ts.map +1 -1
- package/dist/compiler/index.js +3 -3
- 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 +21 -0
- package/dist/compiler/plugins/base.d.ts.map +1 -1
- package/dist/compiler/plugins/base.js +13 -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 +35 -9
- package/dist/compiler/plugins/skill.plugin.d.ts.map +1 -1
- package/dist/compiler/plugins/skill.plugin.js +129 -87
- 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/types.d.ts +33 -0
- package/dist/compiler/types.d.ts.map +1 -1
- package/dist/compiler/types.js.map +1 -1
- package/dist/compiler/utils/ast-helpers.d.ts +1 -16
- package/dist/compiler/utils/ast-helpers.d.ts.map +1 -1
- package/dist/compiler/utils/ast-helpers.js +14 -38
- package/dist/compiler/utils/ast-helpers.js.map +1 -1
- package/dist/compiler/utils/common.d.ts +14 -0
- package/dist/compiler/utils/common.d.ts.map +1 -1
- package/dist/compiler/utils/common.js +39 -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 +67 -10
- package/dist/compiler/utils/path-resolver.d.ts.map +1 -1
- package/dist/compiler/utils/path-resolver.js +120 -24
- package/dist/compiler/utils/path-resolver.js.map +1 -1
- package/dist/compiler/utils/reference-resolver.d.ts +196 -0
- package/dist/compiler/utils/reference-resolver.d.ts.map +1 -0
- package/dist/compiler/utils/reference-resolver.js +1026 -0
- package/dist/compiler/utils/reference-resolver.js.map +1 -0
- package/dist/compiler/utils/schema-converter.d.ts +25 -0
- package/dist/compiler/utils/schema-converter.d.ts.map +1 -1
- package/dist/compiler/utils/schema-converter.js +80 -4
- package/dist/compiler/utils/schema-converter.js.map +1 -1
- package/dist/compiler/utils/workspace.d.ts +35 -0
- package/dist/compiler/utils/workspace.d.ts.map +1 -0
- package/dist/compiler/utils/workspace.js +121 -0
- package/dist/compiler/utils/workspace.js.map +1 -0
- package/dist/compiler/utils/zod-runtime.mjs +5334 -0
- 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 +9 -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/backup.d.ts +19 -1
- package/dist/interfaces/backup.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/logs.d.ts +7 -4
- package/dist/interfaces/logs.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 +12 -2
- package/dist/primitives/base.handler.d.ts.map +1 -1
- package/dist/primitives/base.handler.js +104 -73
- 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 +6 -1
- package/dist/primitives/job.handler.d.ts.map +1 -1
- package/dist/primitives/job.handler.js +9 -3
- 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 +3 -2
- package/dist/primitives/webhook.handler.d.ts.map +1 -1
- package/dist/primitives/webhook.handler.js +9 -4
- 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 +9 -1
- package/dist/services/auth.d.ts.map +1 -1
- package/dist/services/auth.js +26 -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 +132 -80
- 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 +7 -0
- package/dist/utils/aliases.d.ts.map +1 -0
- package/dist/utils/aliases.js +492 -0
- package/dist/utils/aliases.js.map +1 -0
- 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 +24 -0
- package/dist/utils/backup-helpers.d.ts.map +1 -1
- package/dist/utils/backup-helpers.js +102 -22
- 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 +24 -6
- package/dist/utils/cli.d.ts.map +1 -1
- package/dist/utils/cli.js +26 -14
- 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 +81 -0
- package/dist/utils/hints.d.ts.map +1 -0
- package/dist/utils/hints.js +81 -0
- package/dist/utils/hints.js.map +1 -0
- 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 +3 -0
- package/dist/utils/suggest.d.ts.map +1 -0
- package/dist/utils/suggest.js +32 -0
- package/dist/utils/suggest.js.map +1 -0
- 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/dist/utils/write-info.d.ts +9 -0
- package/dist/utils/write-info.d.ts.map +1 -0
- package/dist/utils/write-info.js +11 -0
- package/dist/utils/write-info.js.map +1 -0
- package/docs/README.md +1 -1
- package/node_modules/@lua/shared-types/dist/index.d.mts +76 -2
- package/node_modules/@lua/shared-types/dist/index.d.ts +76 -2
- package/node_modules/@lua/shared-types/dist/index.js +27 -0
- package/node_modules/@lua/shared-types/dist/index.mjs +24 -0
- 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/channel.type.ts +1 -0
- package/node_modules/@lua/shared-types/src/chat-stream.types.ts +11 -0
- package/node_modules/@lua/shared-types/src/client-tools.types.ts +47 -0
- package/node_modules/@lua/shared-types/src/device.types.ts +6 -6
- package/node_modules/@lua/shared-types/src/index.ts +3 -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 +41 -0
- package/package.json +10 -6
- package/scripts/build-vendor.mjs +53 -0
- package/scripts/vendor-entry.mjs +11 -0
- 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 -67
- 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 +81 -79
- 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,13 +2,14 @@
|
|
|
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';
|
|
12
|
+
import { validateOrSuggest } from '../utils/aliases.js';
|
|
12
13
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
13
14
|
// Main Command Entry
|
|
14
15
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -32,7 +33,7 @@ export async function channelsCommand(action) {
|
|
|
32
33
|
await channelsInteractive(agentApi, agentId, apiKey, config);
|
|
33
34
|
}
|
|
34
35
|
trackEvent('cli_channels_action', { action: action || 'interactive', non_interactive: !!action });
|
|
35
|
-
},
|
|
36
|
+
}, 'channels management');
|
|
36
37
|
}
|
|
37
38
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
38
39
|
// Shared Core Functions
|
|
@@ -53,12 +54,12 @@ async function fetchChannelsCore(agentApi, agentId) {
|
|
|
53
54
|
*/
|
|
54
55
|
function getChannelIcon(type) {
|
|
55
56
|
const icons = {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
whatsapp: '📱',
|
|
58
|
+
facebook: '💬',
|
|
59
|
+
instagram: '📸',
|
|
60
|
+
slack: '💼',
|
|
61
|
+
email: '📧',
|
|
62
|
+
webchat: '💻',
|
|
62
63
|
};
|
|
63
64
|
return icons[type] || '📡';
|
|
64
65
|
}
|
|
@@ -85,11 +86,11 @@ function getChannelLabel(channel) {
|
|
|
85
86
|
* Displays all channels (non-interactive).
|
|
86
87
|
*/
|
|
87
88
|
function displayChannelsCore(channels) {
|
|
88
|
-
console.log(
|
|
89
|
-
console.log(
|
|
90
|
-
console.log(
|
|
89
|
+
console.log('\n' + '='.repeat(60));
|
|
90
|
+
console.log('📡 Agent Channels');
|
|
91
|
+
console.log('='.repeat(60) + '\n');
|
|
91
92
|
if (channels.length === 0) {
|
|
92
|
-
console.log(
|
|
93
|
+
console.log('ℹ️ No channels configured for this agent.');
|
|
93
94
|
console.log("💡 Use 'lua channels' (interactive) to add channels.\n");
|
|
94
95
|
return;
|
|
95
96
|
}
|
|
@@ -103,28 +104,18 @@ function displayChannelsCore(channels) {
|
|
|
103
104
|
console.log(` Created: ${created}`);
|
|
104
105
|
console.log();
|
|
105
106
|
});
|
|
106
|
-
console.log(
|
|
107
|
+
console.log('='.repeat(60));
|
|
107
108
|
console.log(`Total: ${channels.length} channel(s)`);
|
|
108
109
|
}
|
|
109
110
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
110
111
|
// Non-Interactive Mode
|
|
111
112
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
112
113
|
async function executeNonInteractive(agentApi, agentId, action) {
|
|
113
|
-
|
|
114
|
-
const normalizedAction = action.toLowerCase();
|
|
115
|
-
if (!validActions.includes(normalizedAction)) {
|
|
116
|
-
console.error(`❌ Invalid action: "${action}"`);
|
|
117
|
-
console.log('\nValid actions: list');
|
|
118
|
-
console.log('\nNote: Channel creation requires interactive mode.');
|
|
119
|
-
console.log('\nExamples:');
|
|
120
|
-
console.log(' lua channels list List all channels');
|
|
121
|
-
console.log(' lua channels Interactive mode');
|
|
122
|
-
throw new Error("Invalid action:");
|
|
123
|
-
}
|
|
114
|
+
action = validateOrSuggest('channels.action', action);
|
|
124
115
|
writeInfo(`📡 Fetching channels for agent: ${agentId}...`);
|
|
125
116
|
const channels = await fetchChannelsCore(agentApi, agentId);
|
|
126
117
|
if (!channels)
|
|
127
|
-
throw new Error(
|
|
118
|
+
throw new Error('Operation failed');
|
|
128
119
|
displayChannelsCore(channels);
|
|
129
120
|
}
|
|
130
121
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -133,25 +124,25 @@ async function executeNonInteractive(agentApi, agentId, action) {
|
|
|
133
124
|
async function channelsInteractive(agentApi, agentId, apiKey, config) {
|
|
134
125
|
const { operation } = await inquirer.prompt([
|
|
135
126
|
{
|
|
136
|
-
type:
|
|
137
|
-
name:
|
|
138
|
-
message:
|
|
127
|
+
type: 'list',
|
|
128
|
+
name: 'operation',
|
|
129
|
+
message: 'What would you like to do?',
|
|
139
130
|
choices: [
|
|
140
|
-
{ name:
|
|
141
|
-
{ name:
|
|
142
|
-
{ name:
|
|
143
|
-
]
|
|
144
|
-
}
|
|
131
|
+
{ name: '📋 List channels', value: 'list' },
|
|
132
|
+
{ name: '🔗 Link new channel', value: 'create' },
|
|
133
|
+
{ name: '🌐 Link on admin dashboard', value: 'admin' },
|
|
134
|
+
],
|
|
135
|
+
},
|
|
145
136
|
]);
|
|
146
137
|
clearPromptLines(2);
|
|
147
138
|
trackEvent('cli_channels_interactive_action', { operation });
|
|
148
|
-
if (operation ===
|
|
139
|
+
if (operation === 'list') {
|
|
149
140
|
await listChannelsInteractive(agentApi, agentId, config);
|
|
150
141
|
}
|
|
151
|
-
else if (operation ===
|
|
142
|
+
else if (operation === 'create') {
|
|
152
143
|
await createChannel(agentApi, agentId);
|
|
153
144
|
}
|
|
154
|
-
else if (operation ===
|
|
145
|
+
else if (operation === 'admin') {
|
|
155
146
|
await openAdminDashboard(apiKey, config);
|
|
156
147
|
}
|
|
157
148
|
}
|
|
@@ -182,10 +173,10 @@ async function listChannelsInteractive(agentApi, agentId, config) {
|
|
|
182
173
|
writeInfo(`📡 Fetching channels for agent: ${agentId}...`);
|
|
183
174
|
const channels = await fetchChannelsCore(agentApi, agentId);
|
|
184
175
|
if (!channels)
|
|
185
|
-
throw new Error(
|
|
176
|
+
throw new Error('Operation failed');
|
|
186
177
|
writeSuccess(`✅ Found ${channels.length} channel(s)\n`);
|
|
187
178
|
if (channels.length === 0) {
|
|
188
|
-
writeInfo(
|
|
179
|
+
writeInfo('No channels configured for this agent.');
|
|
189
180
|
writeInfo("\n💡 Use the 'Create new channel' option to add channels.\n");
|
|
190
181
|
return;
|
|
191
182
|
}
|
|
@@ -194,20 +185,20 @@ async function listChannelsInteractive(agentApi, agentId, config) {
|
|
|
194
185
|
const label = getChannelLabel(channel);
|
|
195
186
|
return {
|
|
196
187
|
name: `${icon} ${channel.type.toUpperCase()} - ${label}`,
|
|
197
|
-
value: index
|
|
188
|
+
value: index,
|
|
198
189
|
};
|
|
199
190
|
});
|
|
200
191
|
channelChoices.push({
|
|
201
192
|
name: '← Back to main menu',
|
|
202
|
-
value: -1
|
|
193
|
+
value: -1,
|
|
203
194
|
});
|
|
204
195
|
const { selectedIndex } = await inquirer.prompt([
|
|
205
196
|
{
|
|
206
|
-
type:
|
|
207
|
-
name:
|
|
208
|
-
message:
|
|
209
|
-
choices: channelChoices
|
|
210
|
-
}
|
|
197
|
+
type: 'list',
|
|
198
|
+
name: 'selectedIndex',
|
|
199
|
+
message: 'Select a channel to view details:',
|
|
200
|
+
choices: channelChoices,
|
|
201
|
+
},
|
|
211
202
|
]);
|
|
212
203
|
if (selectedIndex === -1) {
|
|
213
204
|
return;
|
|
@@ -374,34 +365,34 @@ function displayEmailDetails(channel) {
|
|
|
374
365
|
async function createChannel(agentApi, agentId) {
|
|
375
366
|
const { channelType } = await inquirer.prompt([
|
|
376
367
|
{
|
|
377
|
-
type:
|
|
378
|
-
name:
|
|
379
|
-
message:
|
|
368
|
+
type: 'list',
|
|
369
|
+
name: 'channelType',
|
|
370
|
+
message: 'Select channel type:',
|
|
380
371
|
choices: [
|
|
381
|
-
{ name:
|
|
382
|
-
{ name:
|
|
383
|
-
{ name:
|
|
384
|
-
{ name:
|
|
385
|
-
{ name:
|
|
386
|
-
]
|
|
387
|
-
}
|
|
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
|
+
},
|
|
388
379
|
]);
|
|
389
380
|
clearPromptLines(2);
|
|
390
381
|
trackEvent('cli_channel_created', { channel_type: channelType });
|
|
391
382
|
switch (channelType) {
|
|
392
|
-
case
|
|
383
|
+
case 'whatsapp':
|
|
393
384
|
await createWhatsAppChannel(agentApi, agentId);
|
|
394
385
|
break;
|
|
395
|
-
case
|
|
386
|
+
case 'facebook':
|
|
396
387
|
await createFacebookChannel(agentApi, agentId);
|
|
397
388
|
break;
|
|
398
|
-
case
|
|
389
|
+
case 'email':
|
|
399
390
|
await createEmailChannel(agentApi, agentId);
|
|
400
391
|
break;
|
|
401
|
-
case
|
|
392
|
+
case 'slack-private':
|
|
402
393
|
await createSlackPrivateChannel(agentApi, agentId);
|
|
403
394
|
break;
|
|
404
|
-
case
|
|
395
|
+
case 'slack-public':
|
|
405
396
|
await createSlackPublicChannel(agentApi, agentId);
|
|
406
397
|
break;
|
|
407
398
|
}
|
|
@@ -410,44 +401,44 @@ async function createChannel(agentApi, agentId) {
|
|
|
410
401
|
* Creates a WhatsApp channel
|
|
411
402
|
*/
|
|
412
403
|
async function createWhatsAppChannel(agentApi, agentId) {
|
|
413
|
-
writeInfo(
|
|
404
|
+
writeInfo('📱 Creating WhatsApp Channel\n');
|
|
414
405
|
const answers = await inquirer.prompt([
|
|
415
406
|
{
|
|
416
|
-
type:
|
|
417
|
-
name:
|
|
418
|
-
message:
|
|
407
|
+
type: 'input',
|
|
408
|
+
name: 'phoneNumberId',
|
|
409
|
+
message: 'Enter phone number ID:',
|
|
419
410
|
validate: (input) => {
|
|
420
|
-
return input.trim().length > 0 ||
|
|
421
|
-
}
|
|
411
|
+
return input.trim().length > 0 || 'Phone number ID is required';
|
|
412
|
+
},
|
|
422
413
|
},
|
|
423
414
|
{
|
|
424
|
-
type:
|
|
425
|
-
name:
|
|
426
|
-
message:
|
|
415
|
+
type: 'input',
|
|
416
|
+
name: 'wabaId',
|
|
417
|
+
message: 'Enter WhatsApp Business Account ID (WABA ID):',
|
|
427
418
|
validate: (input) => {
|
|
428
|
-
return input.trim().length > 0 ||
|
|
429
|
-
}
|
|
419
|
+
return input.trim().length > 0 || 'WABA ID is required';
|
|
420
|
+
},
|
|
430
421
|
},
|
|
431
422
|
{
|
|
432
|
-
type:
|
|
433
|
-
name:
|
|
434
|
-
message:
|
|
435
|
-
mask:
|
|
423
|
+
type: 'password',
|
|
424
|
+
name: 'accessToken',
|
|
425
|
+
message: 'Enter access token:',
|
|
426
|
+
mask: '*',
|
|
436
427
|
validate: (input) => {
|
|
437
|
-
return input.trim().length > 0 ||
|
|
438
|
-
}
|
|
439
|
-
}
|
|
428
|
+
return input.trim().length > 0 || 'Access token is required';
|
|
429
|
+
},
|
|
430
|
+
},
|
|
440
431
|
]);
|
|
441
432
|
const channelData = {
|
|
442
|
-
type:
|
|
433
|
+
type: 'whatsapp',
|
|
443
434
|
whatsapp: {
|
|
444
435
|
phoneNumberId: answers.phoneNumberId.trim(),
|
|
445
436
|
wabaId: answers.wabaId.trim(),
|
|
446
|
-
accessToken: answers.accessToken.trim()
|
|
437
|
+
accessToken: answers.accessToken.trim(),
|
|
447
438
|
},
|
|
448
|
-
isManual: true
|
|
439
|
+
isManual: true,
|
|
449
440
|
};
|
|
450
|
-
writeInfo(
|
|
441
|
+
writeInfo('\n📡 Creating WhatsApp channel...');
|
|
451
442
|
const response = await agentApi.createWhatsAppChannel(agentId, channelData);
|
|
452
443
|
if (!response.success) {
|
|
453
444
|
const error = response.error;
|
|
@@ -462,10 +453,10 @@ async function createWhatsAppChannel(agentApi, agentId) {
|
|
|
462
453
|
console.error(` ${error.error}\n`);
|
|
463
454
|
}
|
|
464
455
|
}
|
|
465
|
-
throw new Error(
|
|
456
|
+
throw new Error('Operation failed');
|
|
466
457
|
}
|
|
467
458
|
const data = response.data;
|
|
468
|
-
writeSuccess(
|
|
459
|
+
writeSuccess('\n✅ WhatsApp channel created successfully!\n');
|
|
469
460
|
writeInfo(`📞 Phone Number: ${data.whatsapp.number}`);
|
|
470
461
|
writeInfo(`🆔 Identifier: ${data.identifier}`);
|
|
471
462
|
writeInfo(`✅ Status: ${data.whatsapp.metadata.status}`);
|
|
@@ -475,34 +466,34 @@ async function createWhatsAppChannel(agentApi, agentId) {
|
|
|
475
466
|
* Creates a Facebook Messenger channel
|
|
476
467
|
*/
|
|
477
468
|
async function createFacebookChannel(agentApi, agentId) {
|
|
478
|
-
writeInfo(
|
|
469
|
+
writeInfo('💬 Creating Facebook Messenger Channel\n');
|
|
479
470
|
const answers = await inquirer.prompt([
|
|
480
471
|
{
|
|
481
|
-
type:
|
|
482
|
-
name:
|
|
483
|
-
message:
|
|
484
|
-
mask:
|
|
472
|
+
type: 'password',
|
|
473
|
+
name: 'accessToken',
|
|
474
|
+
message: 'Enter Facebook page access token:',
|
|
475
|
+
mask: '*',
|
|
485
476
|
validate: (input) => {
|
|
486
|
-
return input.trim().length > 0 ||
|
|
487
|
-
}
|
|
477
|
+
return input.trim().length > 0 || 'Access token is required';
|
|
478
|
+
},
|
|
488
479
|
},
|
|
489
480
|
{
|
|
490
|
-
type:
|
|
491
|
-
name:
|
|
492
|
-
message:
|
|
481
|
+
type: 'input',
|
|
482
|
+
name: 'pageId',
|
|
483
|
+
message: 'Enter Facebook page ID:',
|
|
493
484
|
validate: (input) => {
|
|
494
|
-
return input.trim().length > 0 ||
|
|
495
|
-
}
|
|
496
|
-
}
|
|
485
|
+
return input.trim().length > 0 || 'Page ID is required';
|
|
486
|
+
},
|
|
487
|
+
},
|
|
497
488
|
]);
|
|
498
489
|
const channelData = {
|
|
499
|
-
type:
|
|
490
|
+
type: 'facebook',
|
|
500
491
|
facebook: {
|
|
501
492
|
accessToken: answers.accessToken.trim(),
|
|
502
|
-
pageId: answers.pageId.trim()
|
|
503
|
-
}
|
|
493
|
+
pageId: answers.pageId.trim(),
|
|
494
|
+
},
|
|
504
495
|
};
|
|
505
|
-
writeInfo(
|
|
496
|
+
writeInfo('\n📡 Creating Facebook channel...');
|
|
506
497
|
const response = await agentApi.createFacebookChannel(agentId, channelData);
|
|
507
498
|
if (!response.success) {
|
|
508
499
|
const error = response.error;
|
|
@@ -517,10 +508,10 @@ async function createFacebookChannel(agentApi, agentId) {
|
|
|
517
508
|
console.error(` ${error.error}\n`);
|
|
518
509
|
}
|
|
519
510
|
}
|
|
520
|
-
throw new Error(
|
|
511
|
+
throw new Error('Operation failed');
|
|
521
512
|
}
|
|
522
513
|
const data = response.data;
|
|
523
|
-
writeSuccess(
|
|
514
|
+
writeSuccess('\n✅ Facebook channel created successfully!\n');
|
|
524
515
|
writeInfo(`📄 Page Name: ${data.facebook.name}`);
|
|
525
516
|
writeInfo(`🆔 Identifier: ${data.identifier}`);
|
|
526
517
|
writeInfo(`📋 Category: ${data.facebook.category}`);
|
|
@@ -530,57 +521,57 @@ async function createFacebookChannel(agentApi, agentId) {
|
|
|
530
521
|
* Creates an Email channel
|
|
531
522
|
*/
|
|
532
523
|
async function createEmailChannel(agentApi, agentId) {
|
|
533
|
-
writeInfo(
|
|
524
|
+
writeInfo('📧 Creating Email Channel\n');
|
|
534
525
|
const { mode } = await inquirer.prompt([
|
|
535
526
|
{
|
|
536
|
-
type:
|
|
537
|
-
name:
|
|
538
|
-
message:
|
|
527
|
+
type: 'list',
|
|
528
|
+
name: 'mode',
|
|
529
|
+
message: 'Select email channel mode:',
|
|
539
530
|
choices: [
|
|
540
|
-
{ name:
|
|
541
|
-
{ name:
|
|
542
|
-
]
|
|
543
|
-
}
|
|
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
|
+
},
|
|
544
535
|
]);
|
|
545
536
|
clearPromptLines(2);
|
|
546
537
|
const { displayName } = await inquirer.prompt([
|
|
547
538
|
{
|
|
548
|
-
type:
|
|
549
|
-
name:
|
|
550
|
-
message:
|
|
539
|
+
type: 'input',
|
|
540
|
+
name: 'displayName',
|
|
541
|
+
message: 'Enter display name (shown in email header):',
|
|
551
542
|
validate: (input) => {
|
|
552
|
-
return input.trim().length > 0 ||
|
|
553
|
-
}
|
|
554
|
-
}
|
|
543
|
+
return input.trim().length > 0 || 'Display name is required';
|
|
544
|
+
},
|
|
545
|
+
},
|
|
555
546
|
]);
|
|
556
547
|
const channelData = {
|
|
557
|
-
type:
|
|
548
|
+
type: 'email',
|
|
558
549
|
email: {
|
|
559
550
|
mode: mode,
|
|
560
551
|
displayName: displayName.trim(),
|
|
561
|
-
}
|
|
552
|
+
},
|
|
562
553
|
};
|
|
563
|
-
if (mode ===
|
|
554
|
+
if (mode === 'existing') {
|
|
564
555
|
const { email } = await inquirer.prompt([
|
|
565
556
|
{
|
|
566
|
-
type:
|
|
567
|
-
name:
|
|
568
|
-
message:
|
|
557
|
+
type: 'input',
|
|
558
|
+
name: 'email',
|
|
559
|
+
message: 'Enter sender email address:',
|
|
569
560
|
validate: (input) => {
|
|
570
561
|
if (input.trim().length === 0) {
|
|
571
|
-
return
|
|
562
|
+
return 'Email address is required';
|
|
572
563
|
}
|
|
573
564
|
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
574
565
|
if (!emailRegex.test(input.trim())) {
|
|
575
|
-
return
|
|
566
|
+
return 'Please enter a valid email address';
|
|
576
567
|
}
|
|
577
568
|
return true;
|
|
578
|
-
}
|
|
579
|
-
}
|
|
569
|
+
},
|
|
570
|
+
},
|
|
580
571
|
]);
|
|
581
572
|
channelData.email.email = email.trim();
|
|
582
573
|
}
|
|
583
|
-
writeInfo(
|
|
574
|
+
writeInfo('\n📡 Creating Email channel...');
|
|
584
575
|
const response = await agentApi.createEmailChannel(agentId, channelData);
|
|
585
576
|
if (!response.success) {
|
|
586
577
|
const error = response.error;
|
|
@@ -595,12 +586,12 @@ async function createEmailChannel(agentApi, agentId) {
|
|
|
595
586
|
console.error(` ${error.error}\n`);
|
|
596
587
|
}
|
|
597
588
|
}
|
|
598
|
-
throw new Error(
|
|
589
|
+
throw new Error('Operation failed');
|
|
599
590
|
}
|
|
600
591
|
const data = response.data;
|
|
601
|
-
writeSuccess(
|
|
592
|
+
writeSuccess('\n✅ Email channel created successfully!\n');
|
|
602
593
|
writeInfo(`📧 Display Name: ${displayName}`);
|
|
603
|
-
if (mode ===
|
|
594
|
+
if (mode === 'generated') {
|
|
604
595
|
const generatedData = data;
|
|
605
596
|
writeInfo(`📬 Email Address: ${generatedData.emailAddress}\n`);
|
|
606
597
|
writeInfo(`${'─'.repeat(60)}`);
|
|
@@ -632,32 +623,32 @@ async function createEmailChannel(agentApi, agentId) {
|
|
|
632
623
|
* Creates a private Slack channel
|
|
633
624
|
*/
|
|
634
625
|
async function createSlackPrivateChannel(agentApi, agentId) {
|
|
635
|
-
writeInfo(
|
|
626
|
+
writeInfo('🔒 Creating Private Slack Channel\n');
|
|
636
627
|
const answers = await inquirer.prompt([
|
|
637
628
|
{
|
|
638
|
-
type:
|
|
639
|
-
name:
|
|
640
|
-
message:
|
|
641
|
-
mask:
|
|
629
|
+
type: 'password',
|
|
630
|
+
name: 'accessToken',
|
|
631
|
+
message: 'Enter Slack bot access token (xoxb-...):',
|
|
632
|
+
mask: '*',
|
|
642
633
|
validate: (input) => {
|
|
643
634
|
if (input.trim().length === 0) {
|
|
644
|
-
return
|
|
635
|
+
return 'Access token is required';
|
|
645
636
|
}
|
|
646
|
-
if (!input.trim().startsWith(
|
|
637
|
+
if (!input.trim().startsWith('xoxb-')) {
|
|
647
638
|
return "Bot token should start with 'xoxb-'";
|
|
648
639
|
}
|
|
649
640
|
return true;
|
|
650
|
-
}
|
|
651
|
-
}
|
|
641
|
+
},
|
|
642
|
+
},
|
|
652
643
|
]);
|
|
653
644
|
const channelData = {
|
|
654
|
-
type:
|
|
645
|
+
type: 'slack',
|
|
655
646
|
slack: {
|
|
656
|
-
type:
|
|
657
|
-
accessToken: answers.accessToken.trim()
|
|
658
|
-
}
|
|
647
|
+
type: 'private',
|
|
648
|
+
accessToken: answers.accessToken.trim(),
|
|
649
|
+
},
|
|
659
650
|
};
|
|
660
|
-
writeInfo(
|
|
651
|
+
writeInfo('\n📡 Creating Slack private channel...');
|
|
661
652
|
const response = await agentApi.createSlackChannel(agentId, channelData);
|
|
662
653
|
if (!response.success) {
|
|
663
654
|
const error = response.error;
|
|
@@ -672,11 +663,11 @@ async function createSlackPrivateChannel(agentApi, agentId) {
|
|
|
672
663
|
console.error(` ${error.error}\n`);
|
|
673
664
|
}
|
|
674
665
|
}
|
|
675
|
-
throw new Error(
|
|
666
|
+
throw new Error('Operation failed');
|
|
676
667
|
}
|
|
677
668
|
const data = response.data;
|
|
678
669
|
if ('slack' in data && 'botName' in data.slack) {
|
|
679
|
-
writeSuccess(
|
|
670
|
+
writeSuccess('\n✅ Slack private channel created successfully!\n');
|
|
680
671
|
writeInfo(`🤖 Bot Name: ${data.slack.botName}`);
|
|
681
672
|
writeInfo(`🏢 Workspace: ${data.slack.url}`);
|
|
682
673
|
writeInfo(`🆔 Bot ID: ${data.slack.botId}`);
|
|
@@ -688,44 +679,44 @@ async function createSlackPrivateChannel(agentApi, agentId) {
|
|
|
688
679
|
* Creates a public Slack channel
|
|
689
680
|
*/
|
|
690
681
|
async function createSlackPublicChannel(agentApi, agentId) {
|
|
691
|
-
writeInfo(
|
|
682
|
+
writeInfo('🌐 Creating Public Slack Channel\n');
|
|
692
683
|
const answers = await inquirer.prompt([
|
|
693
684
|
{
|
|
694
|
-
type:
|
|
695
|
-
name:
|
|
696
|
-
message:
|
|
685
|
+
type: 'input',
|
|
686
|
+
name: 'appId',
|
|
687
|
+
message: 'Enter Slack app ID:',
|
|
697
688
|
validate: (input) => {
|
|
698
|
-
return input.trim().length > 0 ||
|
|
699
|
-
}
|
|
689
|
+
return input.trim().length > 0 || 'App ID is required';
|
|
690
|
+
},
|
|
700
691
|
},
|
|
701
692
|
{
|
|
702
|
-
type:
|
|
703
|
-
name:
|
|
704
|
-
message:
|
|
693
|
+
type: 'input',
|
|
694
|
+
name: 'clientId',
|
|
695
|
+
message: 'Enter Slack client ID:',
|
|
705
696
|
validate: (input) => {
|
|
706
|
-
return input.trim().length > 0 ||
|
|
707
|
-
}
|
|
697
|
+
return input.trim().length > 0 || 'Client ID is required';
|
|
698
|
+
},
|
|
708
699
|
},
|
|
709
700
|
{
|
|
710
|
-
type:
|
|
711
|
-
name:
|
|
712
|
-
message:
|
|
713
|
-
mask:
|
|
701
|
+
type: 'password',
|
|
702
|
+
name: 'clientSecret',
|
|
703
|
+
message: 'Enter Slack client secret:',
|
|
704
|
+
mask: '*',
|
|
714
705
|
validate: (input) => {
|
|
715
|
-
return input.trim().length > 0 ||
|
|
716
|
-
}
|
|
717
|
-
}
|
|
706
|
+
return input.trim().length > 0 || 'Client secret is required';
|
|
707
|
+
},
|
|
708
|
+
},
|
|
718
709
|
]);
|
|
719
710
|
const channelData = {
|
|
720
|
-
type:
|
|
711
|
+
type: 'slack',
|
|
721
712
|
slack: {
|
|
722
|
-
type:
|
|
713
|
+
type: 'public',
|
|
723
714
|
appId: answers.appId.trim(),
|
|
724
715
|
clientId: answers.clientId.trim(),
|
|
725
|
-
clientSecret: answers.clientSecret.trim()
|
|
726
|
-
}
|
|
716
|
+
clientSecret: answers.clientSecret.trim(),
|
|
717
|
+
},
|
|
727
718
|
};
|
|
728
|
-
writeInfo(
|
|
719
|
+
writeInfo('\n📡 Creating Slack public channel...');
|
|
729
720
|
const response = await agentApi.createSlackChannel(agentId, channelData);
|
|
730
721
|
if (!response.success) {
|
|
731
722
|
const error = response.error;
|
|
@@ -740,11 +731,11 @@ async function createSlackPublicChannel(agentApi, agentId) {
|
|
|
740
731
|
console.error(` ${error.error}\n`);
|
|
741
732
|
}
|
|
742
733
|
}
|
|
743
|
-
throw new Error(
|
|
734
|
+
throw new Error('Operation failed');
|
|
744
735
|
}
|
|
745
736
|
const data = response.data;
|
|
746
737
|
if ('redirectUri' in data) {
|
|
747
|
-
writeSuccess(
|
|
738
|
+
writeSuccess('\n✅ Slack public channel created successfully!\n');
|
|
748
739
|
writeInfo(`🆔 App ID: ${data.appId}`);
|
|
749
740
|
writeInfo(`🔗 Redirect URI: ${data.redirectUri}`);
|
|
750
741
|
writeInfo(`🔗 Webhook URL: ${data.webhookUrl}\n`);
|