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
package/dist/commands/logs.js
CHANGED
|
@@ -2,18 +2,34 @@
|
|
|
2
2
|
* Logs Command
|
|
3
3
|
* View and navigate agent/skill logs with pagination
|
|
4
4
|
*/
|
|
5
|
-
import inquirer from
|
|
6
|
-
import chalk from
|
|
7
|
-
import { withErrorHandling, writeSuccess, writeInfo, writeError, clearPromptLines } from
|
|
8
|
-
import { initializeCommand } from
|
|
9
|
-
import LogsApi from '../api/logs.api.service.js';
|
|
5
|
+
import inquirer from 'inquirer';
|
|
6
|
+
import chalk from 'chalk';
|
|
7
|
+
import { withErrorHandling, writeSuccess, writeInfo, writeError, clearPromptLines, writeHintBlock, } from '../utils/cli.js';
|
|
8
|
+
import { initializeCommand } from '../utils/command-utils.js';
|
|
9
|
+
import LogsApi, { AGENT_LOG_SOURCES } from '../api/logs.api.service.js';
|
|
10
|
+
import DeviceApi from '../api/device.api.service.js';
|
|
10
11
|
import { BASE_URLS } from '../config/constants.js';
|
|
11
|
-
import SkillApi from
|
|
12
|
-
import JobApi from
|
|
13
|
-
import WebhookApi from
|
|
14
|
-
import PreprocessorApi from
|
|
15
|
-
import PostprocessorApi from
|
|
12
|
+
import SkillApi from '../api/skills.api.service.js';
|
|
13
|
+
import JobApi from '../api/job.api.service.js';
|
|
14
|
+
import WebhookApi from '../api/webhook.api.service.js';
|
|
15
|
+
import PreprocessorApi from '../api/preprocessor.api.service.js';
|
|
16
|
+
import PostprocessorApi from '../api/postprocessor.api.service.js';
|
|
16
17
|
import { trackEvent } from '../services/analytics.js';
|
|
18
|
+
import { validateOrSuggest } from '../utils/aliases.js';
|
|
19
|
+
// Derived directly from the canonical AGENT_LOG_SOURCES constant â never hardcode this list.
|
|
20
|
+
// Adding a new user-facing source to shared-schemas automatically makes it available here.
|
|
21
|
+
const ALL_VALID_SOURCES = AGENT_LOG_SOURCES;
|
|
22
|
+
// Entity sources: have a browsable list that users can filter by --name
|
|
23
|
+
const ENTITY_SOURCES = new Set([
|
|
24
|
+
'skill',
|
|
25
|
+
'job',
|
|
26
|
+
'webhook',
|
|
27
|
+
'preprocessor',
|
|
28
|
+
'postprocessor',
|
|
29
|
+
'device',
|
|
30
|
+
]);
|
|
31
|
+
// Non-entity sources: present in ALL_VALID_SOURCES but have no selectable entity list
|
|
32
|
+
const NON_ENTITY_SOURCES = new Set(ALL_VALID_SOURCES.filter((s) => !ENTITY_SOURCES.has(s)));
|
|
17
33
|
// âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
18
34
|
// Main Command Entry
|
|
19
35
|
// âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
@@ -52,7 +68,7 @@ export async function logsCommand(cmdObj) {
|
|
|
52
68
|
non_interactive: hasNonInteractiveFlags,
|
|
53
69
|
page_requested: options.page || 1,
|
|
54
70
|
});
|
|
55
|
-
},
|
|
71
|
+
}, 'logs viewing');
|
|
56
72
|
}
|
|
57
73
|
// âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
58
74
|
// Shared Core Functions
|
|
@@ -62,13 +78,16 @@ export async function logsCommand(cmdObj) {
|
|
|
62
78
|
*/
|
|
63
79
|
function renderLogEntry(log, isLast) {
|
|
64
80
|
const timestamp = new Date(log.timestamp).toLocaleString();
|
|
65
|
-
const
|
|
66
|
-
const
|
|
67
|
-
const
|
|
81
|
+
const logSource = log.metadata?.logSource;
|
|
82
|
+
const primitiveId = log.metadata?.primitiveId;
|
|
83
|
+
const primitiveName = log.metadata?.primitiveName;
|
|
84
|
+
const { toolName, channel, userId } = log.metadata;
|
|
85
|
+
const icon = getLogIcon(log.subType, logSource);
|
|
86
|
+
const color = getLogColor(log.subType, logSource);
|
|
68
87
|
console.log(color(`${icon} [${timestamp}] ${log.subType.toUpperCase()}`));
|
|
69
|
-
const capitalizedType =
|
|
88
|
+
const capitalizedType = logSource ? capitalize(logSource) : 'Item';
|
|
70
89
|
// For message types and agent errors, show channel and userId
|
|
71
|
-
if (
|
|
90
|
+
if (logSource === 'user_message' || logSource === 'agent_response' || logSource === 'agent_error') {
|
|
72
91
|
if (channel) {
|
|
73
92
|
console.log(chalk.gray(` Channel: ${channel}`));
|
|
74
93
|
}
|
|
@@ -77,7 +96,7 @@ function renderLogEntry(log, isLast) {
|
|
|
77
96
|
}
|
|
78
97
|
}
|
|
79
98
|
else {
|
|
80
|
-
// For skill/job/webhook types, show
|
|
99
|
+
// For skill/job/webhook types, show source id and name
|
|
81
100
|
if (primitiveName) {
|
|
82
101
|
console.log(chalk.gray(` ${capitalizedType} Name: ${primitiveName}`));
|
|
83
102
|
}
|
|
@@ -85,7 +104,7 @@ function renderLogEntry(log, isLast) {
|
|
|
85
104
|
console.log(chalk.gray(` ${capitalizedType} ID: ${primitiveId}`));
|
|
86
105
|
}
|
|
87
106
|
// Show tool information for skills and MCP
|
|
88
|
-
if ((
|
|
107
|
+
if ((logSource === 'skill' || logSource === 'mcp') && toolName) {
|
|
89
108
|
console.log(chalk.gray(` Tool Name: ${toolName}`));
|
|
90
109
|
}
|
|
91
110
|
}
|
|
@@ -108,7 +127,7 @@ function displayLogsCore(logs, pagination, title, clearScreen = false) {
|
|
|
108
127
|
writeInfo(`${'â'.repeat(80)}`);
|
|
109
128
|
writeInfo(`Page ${pagination.currentPage} of ${pagination.totalPages} (${pagination.totalCount} total logs)\n`);
|
|
110
129
|
if (logs.length === 0) {
|
|
111
|
-
writeInfo(
|
|
130
|
+
writeInfo('No logs found.');
|
|
112
131
|
return;
|
|
113
132
|
}
|
|
114
133
|
// Reverse logs so latest appears at the bottom
|
|
@@ -122,29 +141,31 @@ function displayLogsCore(logs, pagination, title, clearScreen = false) {
|
|
|
122
141
|
* Fetches entities by type for filtering.
|
|
123
142
|
*/
|
|
124
143
|
async function fetchEntitiesByType(apiKey, agentId, type) {
|
|
125
|
-
const apiServices = {
|
|
126
|
-
skill: new SkillApi(BASE_URLS.API, apiKey, agentId),
|
|
127
|
-
job: new JobApi(BASE_URLS.API, apiKey, agentId),
|
|
128
|
-
webhook: new WebhookApi(BASE_URLS.API, apiKey, agentId),
|
|
129
|
-
preprocessor: new PreprocessorApi(BASE_URLS.API, apiKey, agentId),
|
|
130
|
-
postprocessor: new PostprocessorApi(BASE_URLS.API, apiKey, agentId),
|
|
131
|
-
};
|
|
132
144
|
switch (type) {
|
|
133
|
-
case 'skill':
|
|
134
|
-
const
|
|
135
|
-
return
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
case '
|
|
146
|
-
const
|
|
147
|
-
return
|
|
145
|
+
case 'skill': {
|
|
146
|
+
const res = await new SkillApi(BASE_URLS.API, apiKey, agentId).getSkills();
|
|
147
|
+
return res.data?.skills || [];
|
|
148
|
+
}
|
|
149
|
+
case 'job': {
|
|
150
|
+
const res = await new JobApi(BASE_URLS.API, apiKey, agentId).getJobs({ includeDynamic: true });
|
|
151
|
+
return res.data?.jobs || [];
|
|
152
|
+
}
|
|
153
|
+
case 'webhook': {
|
|
154
|
+
const res = await new WebhookApi(BASE_URLS.API, apiKey, agentId).getWebhooks();
|
|
155
|
+
return res.data?.webhooks || [];
|
|
156
|
+
}
|
|
157
|
+
case 'preprocessor': {
|
|
158
|
+
const res = await new PreprocessorApi(BASE_URLS.API, apiKey, agentId).getPreProcessors();
|
|
159
|
+
return res.data?.preprocessors || [];
|
|
160
|
+
}
|
|
161
|
+
case 'postprocessor': {
|
|
162
|
+
const res = await new PostprocessorApi(BASE_URLS.API, apiKey, agentId).getPostProcessors();
|
|
163
|
+
return res.data?.postprocessors || [];
|
|
164
|
+
}
|
|
165
|
+
case 'device': {
|
|
166
|
+
const res = await new DeviceApi(BASE_URLS.API, apiKey, agentId).getDevices();
|
|
167
|
+
return res.data?.devices || [];
|
|
168
|
+
}
|
|
148
169
|
default:
|
|
149
170
|
return [];
|
|
150
171
|
}
|
|
@@ -162,34 +183,28 @@ async function resolveEntityId(apiKey, agentId, type, nameOrId) {
|
|
|
162
183
|
// âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
163
184
|
async function nonInteractiveLogs(logsApi, agentId, apiKey, options) {
|
|
164
185
|
const filters = {};
|
|
165
|
-
// Validate and set
|
|
186
|
+
// Validate and set log source filter
|
|
166
187
|
if (options.type && options.type !== 'all') {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
console.error(`â Invalid type: "${options.type}"`);
|
|
170
|
-
console.log('\nValid types: all, skill, job, webhook, preprocessor, postprocessor, user_message, agent_response, agent_error, mcp, mastra, rag');
|
|
171
|
-
throw new Error("Invalid type:");
|
|
172
|
-
}
|
|
173
|
-
filters.primitiveType = options.type;
|
|
188
|
+
options.type = validateOrSuggest('logs.type', options.type);
|
|
189
|
+
filters.logSource = options.type;
|
|
174
190
|
}
|
|
175
191
|
// Resolve entity name if provided
|
|
176
192
|
if (options.name) {
|
|
177
|
-
if (!filters.
|
|
193
|
+
if (!filters.logSource) {
|
|
178
194
|
console.error('â --type is required when using --name');
|
|
179
195
|
console.log('\nUsage: lua logs --type skill --name mySkill');
|
|
180
|
-
throw new Error(
|
|
196
|
+
throw new Error('--type is required when using --name');
|
|
181
197
|
}
|
|
182
|
-
//
|
|
183
|
-
if (
|
|
184
|
-
|
|
185
|
-
console.
|
|
186
|
-
|
|
187
|
-
throw new Error("--name is not applicable for ${filters.primitiveType} type");
|
|
198
|
+
// Non-entity log sources don't have IDs to resolve
|
|
199
|
+
if (NON_ENTITY_SOURCES.has(filters.logSource)) {
|
|
200
|
+
console.error(`â --name is not applicable for ${filters.logSource} type`);
|
|
201
|
+
console.log(`\nUsage: lua logs --type ${filters.logSource} (no --name needed)`);
|
|
202
|
+
throw new Error('--name is not applicable for ${filters.logSource} type');
|
|
188
203
|
}
|
|
189
|
-
const entityId = await resolveEntityId(apiKey, agentId, filters.
|
|
204
|
+
const entityId = await resolveEntityId(apiKey, agentId, filters.logSource, options.name);
|
|
190
205
|
if (!entityId) {
|
|
191
|
-
console.error(`â ${capitalize(filters.
|
|
192
|
-
throw new Error(
|
|
206
|
+
console.error(`â ${capitalize(filters.logSource ?? '')} "${options.name}" not found`);
|
|
207
|
+
throw new Error(`${capitalize(filters.logSource ?? '')} "${options.name}" not found`);
|
|
193
208
|
}
|
|
194
209
|
filters.primitiveId = entityId;
|
|
195
210
|
}
|
|
@@ -201,19 +216,28 @@ async function nonInteractiveLogs(logsApi, agentId, apiKey, options) {
|
|
|
201
216
|
const response = await logsApi.getAgentLogs(agentId, options.limit || 20, options.page || 1, filters);
|
|
202
217
|
if (!response.success) {
|
|
203
218
|
console.error(`â Error: ${response.error?.message || 'Unknown error'}`);
|
|
204
|
-
throw new Error(
|
|
219
|
+
throw new Error(`Error: ${response.error?.message || 'Unknown error'}`);
|
|
205
220
|
}
|
|
206
221
|
const data = response.data;
|
|
207
222
|
// Output as JSON or formatted
|
|
208
223
|
if (options.json) {
|
|
209
224
|
console.log(JSON.stringify({
|
|
210
225
|
logs: data.logs,
|
|
211
|
-
pagination: data.pagination
|
|
226
|
+
pagination: data.pagination,
|
|
212
227
|
}, null, 2));
|
|
213
228
|
}
|
|
214
229
|
else {
|
|
215
230
|
const typeLabel = options.type ? capitalize(options.type) : 'All';
|
|
216
231
|
displayLogsCore(data.logs, data.pagination, `đ ${typeLabel} Logs`);
|
|
232
|
+
writeHintBlock({
|
|
233
|
+
headline: 'If you see errors:',
|
|
234
|
+
lines: [
|
|
235
|
+
{ label: 'Fix code, re-push:', command: 'lua push all --force --auto-deploy' },
|
|
236
|
+
{ label: 'Test locally first:', command: 'lua test' },
|
|
237
|
+
{ label: 'Isolate a tool:', command: 'lua chat -e sandbox -m "trigger the tool"' },
|
|
238
|
+
],
|
|
239
|
+
when: 'success',
|
|
240
|
+
});
|
|
217
241
|
}
|
|
218
242
|
}
|
|
219
243
|
// âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
|
|
@@ -222,17 +246,17 @@ async function nonInteractiveLogs(logsApi, agentId, apiKey, options) {
|
|
|
222
246
|
async function interactiveLogs(logsApi, agentId, apiKey) {
|
|
223
247
|
const { viewType } = await inquirer.prompt([
|
|
224
248
|
{
|
|
225
|
-
type:
|
|
226
|
-
name:
|
|
227
|
-
message:
|
|
249
|
+
type: 'list',
|
|
250
|
+
name: 'viewType',
|
|
251
|
+
message: 'What logs do you want to view?',
|
|
228
252
|
choices: [
|
|
229
|
-
{ name:
|
|
230
|
-
{ name:
|
|
253
|
+
{ name: 'đ All agent logs', value: 'all' },
|
|
254
|
+
{ name: 'đ Filter logs', value: 'filter' },
|
|
231
255
|
],
|
|
232
256
|
},
|
|
233
257
|
]);
|
|
234
258
|
clearPromptLines(2);
|
|
235
|
-
if (viewType ===
|
|
259
|
+
if (viewType === 'all') {
|
|
236
260
|
await viewAgentLogsInteractive(logsApi, agentId);
|
|
237
261
|
}
|
|
238
262
|
else {
|
|
@@ -244,73 +268,75 @@ async function filterAndShowLogsInteractive(logsApi, agentId, apiKey) {
|
|
|
244
268
|
while (keepFiltering) {
|
|
245
269
|
const { filterType } = await inquirer.prompt([
|
|
246
270
|
{
|
|
247
|
-
type:
|
|
248
|
-
name:
|
|
249
|
-
message:
|
|
271
|
+
type: 'list',
|
|
272
|
+
name: 'filterType',
|
|
273
|
+
message: 'Filter by:',
|
|
250
274
|
choices: [
|
|
251
|
-
{ name:
|
|
275
|
+
{ name: 'đ All logs', value: 'all' },
|
|
252
276
|
new inquirer.Separator(),
|
|
253
|
-
{ name:
|
|
254
|
-
{ name:
|
|
255
|
-
{ name:
|
|
256
|
-
{ name:
|
|
257
|
-
{ name:
|
|
277
|
+
{ name: 'Skills', value: 'skill' },
|
|
278
|
+
{ name: 'Jobs', value: 'job' },
|
|
279
|
+
{ name: 'Webhooks', value: 'webhook' },
|
|
280
|
+
{ name: 'Preprocessors', value: 'preprocessor' },
|
|
281
|
+
{ name: 'Postprocessors', value: 'postprocessor' },
|
|
282
|
+
{ name: 'Devices', value: 'device' },
|
|
258
283
|
new inquirer.Separator(),
|
|
259
|
-
{ name:
|
|
260
|
-
{ name:
|
|
261
|
-
{ name:
|
|
262
|
-
{ name:
|
|
263
|
-
{ name:
|
|
264
|
-
{ name:
|
|
284
|
+
{ name: 'đŦ User Messages', value: 'user_message' },
|
|
285
|
+
{ name: 'đ¤ Agent Responses', value: 'agent_response' },
|
|
286
|
+
{ name: 'â ī¸ Agent Errors', value: 'agent_error' },
|
|
287
|
+
{ name: 'đ MCP Tools', value: 'mcp' },
|
|
288
|
+
{ name: 'đ§ Runtime', value: 'runtime' },
|
|
289
|
+
{ name: 'đ Knowledge Base (RAG)', value: 'rag' },
|
|
290
|
+
{ name: 'đĄ Device Triggers', value: 'device-trigger' },
|
|
265
291
|
new inquirer.Separator(),
|
|
266
|
-
{ name:
|
|
292
|
+
{ name: 'â Back', value: 'back' },
|
|
267
293
|
new inquirer.Separator(),
|
|
268
294
|
],
|
|
269
295
|
},
|
|
270
296
|
]);
|
|
271
|
-
if (filterType ===
|
|
297
|
+
if (filterType === 'all') {
|
|
272
298
|
await viewAgentLogsInteractive(logsApi, agentId);
|
|
273
299
|
return;
|
|
274
300
|
}
|
|
275
|
-
if (filterType ===
|
|
301
|
+
if (filterType === 'back') {
|
|
276
302
|
await logsCommand();
|
|
277
303
|
return;
|
|
278
304
|
}
|
|
279
|
-
// Handle
|
|
280
|
-
if (filterType
|
|
281
|
-
await viewAgentLogsInteractive(logsApi, agentId, {
|
|
305
|
+
// Handle non-entity log sources (don't have selectable entity lists)
|
|
306
|
+
if (NON_ENTITY_SOURCES.has(filterType)) {
|
|
307
|
+
await viewAgentLogsInteractive(logsApi, agentId, { logSource: filterType });
|
|
282
308
|
continue;
|
|
283
309
|
}
|
|
284
|
-
const
|
|
285
|
-
const capitalizedType = capitalize(
|
|
286
|
-
const items = await fetchEntitiesByType(apiKey, agentId,
|
|
310
|
+
const entitySource = filterType;
|
|
311
|
+
const capitalizedType = capitalize(entitySource);
|
|
312
|
+
const items = await fetchEntitiesByType(apiKey, agentId, entitySource);
|
|
287
313
|
if (items.length === 0) {
|
|
288
|
-
writeInfo(`âšī¸ No ${
|
|
314
|
+
writeInfo(`âšī¸ No ${entitySource}s found for this agent.\n`);
|
|
289
315
|
continue;
|
|
290
316
|
}
|
|
291
317
|
const { selectedId } = await inquirer.prompt([
|
|
292
318
|
{
|
|
293
|
-
type:
|
|
294
|
-
name:
|
|
295
|
-
message: `Select a ${
|
|
319
|
+
type: 'list',
|
|
320
|
+
name: 'selectedId',
|
|
321
|
+
message: `Select a ${entitySource}:`,
|
|
296
322
|
choices: [
|
|
297
|
-
{ name: `All ${capitalizedType}s`, value:
|
|
323
|
+
{ name: `All ${capitalizedType}s`, value: 'all' },
|
|
298
324
|
new inquirer.Separator(),
|
|
299
325
|
...items.map((item) => ({
|
|
300
326
|
name: item.name,
|
|
301
327
|
value: item.id,
|
|
302
328
|
})),
|
|
303
329
|
new inquirer.Separator(),
|
|
304
|
-
{ name:
|
|
330
|
+
{ name: 'â Back', value: 'back' },
|
|
305
331
|
new inquirer.Separator(),
|
|
306
332
|
],
|
|
307
333
|
},
|
|
308
334
|
]);
|
|
309
|
-
if (selectedId ===
|
|
335
|
+
if (selectedId === 'back') {
|
|
310
336
|
continue;
|
|
311
337
|
}
|
|
312
|
-
const filters = {
|
|
313
|
-
if (selectedId !==
|
|
338
|
+
const filters = { logSource: entitySource };
|
|
339
|
+
if (selectedId !== 'all') {
|
|
314
340
|
filters.primitiveId = selectedId;
|
|
315
341
|
}
|
|
316
342
|
await viewAgentLogsInteractive(logsApi, agentId, filters);
|
|
@@ -325,15 +351,15 @@ async function viewAgentLogsInteractive(logsApi, agentId, filters = {}) {
|
|
|
325
351
|
const response = await logsApi.getAgentLogs(agentId, limit, currentPage, filters);
|
|
326
352
|
if (!response.success) {
|
|
327
353
|
writeError(`â Error: ${response.error?.message || 'Unknown error'}`);
|
|
328
|
-
throw new Error(
|
|
354
|
+
throw new Error('Operation failed');
|
|
329
355
|
}
|
|
330
356
|
const data = response.data;
|
|
331
|
-
displayLogsCore(data.logs, data.pagination,
|
|
357
|
+
displayLogsCore(data.logs, data.pagination, 'All Agent Logs', true);
|
|
332
358
|
const { action } = await inquirer.prompt([
|
|
333
359
|
{
|
|
334
|
-
type:
|
|
335
|
-
name:
|
|
336
|
-
message:
|
|
360
|
+
type: 'list',
|
|
361
|
+
name: 'action',
|
|
362
|
+
message: 'Navigation:',
|
|
337
363
|
choices: getNavigationChoices(data.pagination),
|
|
338
364
|
},
|
|
339
365
|
]);
|
|
@@ -343,64 +369,6 @@ async function viewAgentLogsInteractive(logsApi, agentId, filters = {}) {
|
|
|
343
369
|
});
|
|
344
370
|
}
|
|
345
371
|
}
|
|
346
|
-
/**
|
|
347
|
-
* Display logs with color coding (interactive mode with clear screen)
|
|
348
|
-
*/
|
|
349
|
-
function displayLogs(logs, pagination, title) {
|
|
350
|
-
console.clear();
|
|
351
|
-
writeSuccess(`\n${title}\n`);
|
|
352
|
-
writeInfo(`${'â'.repeat(80)}`);
|
|
353
|
-
writeInfo(`Page ${pagination.currentPage} of ${pagination.totalPages} (${pagination.totalCount} total logs)\n`);
|
|
354
|
-
if (logs.length === 0) {
|
|
355
|
-
writeInfo("No logs found.");
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
// Reverse logs so latest appears at the bottom (oldest first, newest last)
|
|
359
|
-
const reversedLogs = [...logs].reverse();
|
|
360
|
-
reversedLogs.forEach((log, index) => {
|
|
361
|
-
const timestamp = new Date(log.timestamp).toLocaleString();
|
|
362
|
-
const { primitiveType, primitiveId, primitiveName, toolName, channel, userId } = log.metadata;
|
|
363
|
-
const icon = getLogIcon(log.subType, primitiveType);
|
|
364
|
-
const color = getLogColor(log.subType, primitiveType);
|
|
365
|
-
console.log(color(`${icon} [${timestamp}] ${log.subType.toUpperCase()}`));
|
|
366
|
-
const capitalizedType = primitiveType
|
|
367
|
-
? primitiveType.charAt(0).toUpperCase() + primitiveType.slice(1)
|
|
368
|
-
: "Item";
|
|
369
|
-
// For message types and agent errors, show channel and userId
|
|
370
|
-
if (primitiveType === "user_message" || primitiveType === "agent_response" || primitiveType === "agent_error") {
|
|
371
|
-
if (channel) {
|
|
372
|
-
console.log(chalk.gray(` Channel: ${channel}`));
|
|
373
|
-
}
|
|
374
|
-
if (userId) {
|
|
375
|
-
console.log(chalk.gray(` User ID: ${userId}`));
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
else {
|
|
379
|
-
// For skill/job/webhook types, show primitiveId and name
|
|
380
|
-
if (primitiveName) {
|
|
381
|
-
console.log(chalk.gray(` ${capitalizedType} Name: ${primitiveName}`));
|
|
382
|
-
}
|
|
383
|
-
if (primitiveId) {
|
|
384
|
-
console.log(chalk.gray(` ${capitalizedType} ID: ${primitiveId}`));
|
|
385
|
-
}
|
|
386
|
-
// Show tool information for skills and MCP
|
|
387
|
-
if (primitiveType === "skill" || primitiveType === "mcp") {
|
|
388
|
-
if (toolName) {
|
|
389
|
-
console.log(chalk.gray(` Tool Name: ${toolName}`));
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
if (log.duration !== undefined) {
|
|
394
|
-
console.log(chalk.gray(` Duration: ${log.duration}ms`));
|
|
395
|
-
}
|
|
396
|
-
// Display full message without truncation
|
|
397
|
-
console.log(` ${log.message}`);
|
|
398
|
-
if (index < reversedLogs.length - 1) {
|
|
399
|
-
console.log(chalk.gray(` ${'-'.repeat(78)}`));
|
|
400
|
-
}
|
|
401
|
-
});
|
|
402
|
-
writeInfo(`\n${'â'.repeat(80)}\n`);
|
|
403
|
-
}
|
|
404
372
|
function getNavigationChoices(pagination) {
|
|
405
373
|
const choices = [];
|
|
406
374
|
if (pagination.hasPrevPage) {
|
|
@@ -428,22 +396,22 @@ async function handleNavigation(action, pagination, setPage) {
|
|
|
428
396
|
return true;
|
|
429
397
|
case 'goto':
|
|
430
398
|
const { page } = await inquirer.prompt({
|
|
431
|
-
type:
|
|
432
|
-
name:
|
|
399
|
+
type: 'number',
|
|
400
|
+
name: 'page',
|
|
433
401
|
message: `Enter page number (1-${pagination.totalPages}):`,
|
|
434
402
|
validate: (input) => {
|
|
435
403
|
if (input === undefined || input < 1 || input > pagination.totalPages) {
|
|
436
404
|
return `Please enter a number between 1 and ${pagination.totalPages}`;
|
|
437
405
|
}
|
|
438
406
|
return true;
|
|
439
|
-
}
|
|
407
|
+
},
|
|
440
408
|
});
|
|
441
409
|
setPage(page);
|
|
442
410
|
return true;
|
|
443
411
|
case 'refresh':
|
|
444
412
|
return true;
|
|
445
413
|
case 'exit':
|
|
446
|
-
writeInfo(
|
|
414
|
+
writeInfo('đ Exiting logs viewer\n');
|
|
447
415
|
return false;
|
|
448
416
|
default:
|
|
449
417
|
return false;
|
|
@@ -455,63 +423,63 @@ async function handleNavigation(action, pagination, setPage) {
|
|
|
455
423
|
function capitalize(str) {
|
|
456
424
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
457
425
|
}
|
|
458
|
-
function getLogIcon(subType,
|
|
459
|
-
// Special icons for
|
|
460
|
-
if (
|
|
426
|
+
function getLogIcon(subType, logSource) {
|
|
427
|
+
// Special icons for specific log sources
|
|
428
|
+
if (logSource === 'user_message') {
|
|
461
429
|
return 'đŦ';
|
|
462
430
|
}
|
|
463
|
-
if (
|
|
431
|
+
if (logSource === 'agent_response') {
|
|
464
432
|
return 'đ¤';
|
|
465
433
|
}
|
|
466
|
-
if (
|
|
434
|
+
if (logSource === 'mcp') {
|
|
467
435
|
return 'đ'; // MCP tool execution
|
|
468
436
|
}
|
|
469
|
-
if (
|
|
470
|
-
return 'đ§ '; //
|
|
437
|
+
if (logSource === 'runtime') {
|
|
438
|
+
return 'đ§ '; // Agent runtime logs
|
|
471
439
|
}
|
|
472
|
-
if (
|
|
440
|
+
if (logSource === 'agent_error') {
|
|
473
441
|
return 'â ī¸'; // Expected agent errors (billing, validation)
|
|
474
442
|
}
|
|
475
|
-
if (
|
|
443
|
+
if (logSource === 'rag') {
|
|
476
444
|
return 'đ'; // RAG knowledge base search
|
|
477
445
|
}
|
|
478
446
|
const icons = {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
447
|
+
error: 'â',
|
|
448
|
+
warn: 'â ī¸',
|
|
449
|
+
debug: 'đ',
|
|
450
|
+
info: 'âšī¸',
|
|
451
|
+
start: 'âļī¸',
|
|
452
|
+
complete: 'â
',
|
|
485
453
|
};
|
|
486
454
|
return icons[subType] || 'đ';
|
|
487
455
|
}
|
|
488
|
-
function getLogColor(subType,
|
|
489
|
-
// Special colors for
|
|
490
|
-
if (
|
|
456
|
+
function getLogColor(subType, logSource) {
|
|
457
|
+
// Special colors for specific log sources
|
|
458
|
+
if (logSource === 'user_message') {
|
|
491
459
|
return chalk.cyan;
|
|
492
460
|
}
|
|
493
|
-
if (
|
|
461
|
+
if (logSource === 'agent_response') {
|
|
494
462
|
return chalk.green;
|
|
495
463
|
}
|
|
496
|
-
if (
|
|
464
|
+
if (logSource === 'mcp') {
|
|
497
465
|
return chalk.magenta; // MCP tool execution
|
|
498
466
|
}
|
|
499
|
-
if (
|
|
500
|
-
return chalk.blue; //
|
|
467
|
+
if (logSource === 'runtime') {
|
|
468
|
+
return chalk.blue; // Agent runtime logs
|
|
501
469
|
}
|
|
502
|
-
if (
|
|
470
|
+
if (logSource === 'agent_error') {
|
|
503
471
|
return chalk.red; // Expected agent errors (billing, validation)
|
|
504
472
|
}
|
|
505
|
-
if (
|
|
473
|
+
if (logSource === 'rag') {
|
|
506
474
|
return chalk.yellow; // RAG knowledge base search
|
|
507
475
|
}
|
|
508
476
|
const colors = {
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
477
|
+
error: chalk.red,
|
|
478
|
+
warn: chalk.yellow,
|
|
479
|
+
debug: chalk.blue,
|
|
480
|
+
info: chalk.cyan,
|
|
481
|
+
start: chalk.green,
|
|
482
|
+
complete: chalk.green,
|
|
515
483
|
};
|
|
516
484
|
return colors[subType] || chalk.white;
|
|
517
485
|
}
|