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
|
@@ -0,0 +1,731 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Status Command
|
|
3
|
+
*
|
|
4
|
+
* Unified state dump of the lua-cli + project + server.
|
|
5
|
+
* Print (or emit as JSON) the full state across all "doctor" sections:
|
|
6
|
+
* environment, install method, updates, auth, project, per-primitive sync,
|
|
7
|
+
* persona, backup, telemetry, and derived next-step hints.
|
|
8
|
+
*
|
|
9
|
+
* Aliases: lua describe.
|
|
10
|
+
*/
|
|
11
|
+
import { readFileSync, existsSync } from 'fs';
|
|
12
|
+
import { fileURLToPath } from 'url';
|
|
13
|
+
import { dirname, join } from 'path';
|
|
14
|
+
import { performance } from 'perf_hooks';
|
|
15
|
+
import * as os from 'os';
|
|
16
|
+
import { withErrorHandling } from '../utils/cli.js';
|
|
17
|
+
import { hintsDisabled } from '../utils/hints.js';
|
|
18
|
+
import { trackEvent } from '../services/analytics.js';
|
|
19
|
+
import { loadApiKey } from '../services/auth.js';
|
|
20
|
+
import AuthApi from '../api/auth.api.service.js';
|
|
21
|
+
import { readYamlConfig } from '../utils/files.js';
|
|
22
|
+
import { loadManifest, getAgentName } from '../utils/artifact-loader.js';
|
|
23
|
+
import { syncableHandlers, isVersionedHandler } from '../primitives/index.js';
|
|
24
|
+
import { compareVersions, parseVersion } from '../utils/semver.js';
|
|
25
|
+
import { isUpdateAvailable, getCachedVersionCheck } from '../utils/version-check.js';
|
|
26
|
+
import { checkPersonaDrift } from '../utils/sync-fetch.js';
|
|
27
|
+
import { getCurrentProjectHash, isBackupOutOfSync } from '../utils/backup-helpers.js';
|
|
28
|
+
import { BASE_URLS, CLI_CONFIG_DIR, TELEMETRY_FILE } from '../config/constants.js';
|
|
29
|
+
import { COMPILE_FILES } from '../config/compile.constants.js';
|
|
30
|
+
import { PrimitiveKind } from '../compiler/types.js';
|
|
31
|
+
// =============================================================================
|
|
32
|
+
// HELPERS
|
|
33
|
+
// =============================================================================
|
|
34
|
+
function getCliVersion() {
|
|
35
|
+
try {
|
|
36
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
37
|
+
const __dirname = dirname(__filename);
|
|
38
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, '../../package.json'), 'utf8'));
|
|
39
|
+
return pkg.version;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return '0.0.0';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function detectInstallMethod(execPath) {
|
|
46
|
+
if (execPath.includes('/.volta/'))
|
|
47
|
+
return 'volta';
|
|
48
|
+
if (execPath.includes('/.nvm/versions/')) {
|
|
49
|
+
const nodeMajor = process.version.split('.')[0].replace('v', '');
|
|
50
|
+
return `nvm-${nodeMajor}`;
|
|
51
|
+
}
|
|
52
|
+
if (execPath.includes('/.fnm/'))
|
|
53
|
+
return 'fnm';
|
|
54
|
+
if (execPath.includes('/pnpm/global/'))
|
|
55
|
+
return 'pnpm-global';
|
|
56
|
+
if (execPath.includes('/.bun/install/'))
|
|
57
|
+
return 'bun-install';
|
|
58
|
+
if (execPath.startsWith('/usr/local/') || execPath.startsWith('/opt/homebrew/')) {
|
|
59
|
+
return 'homebrew-or-npm-global';
|
|
60
|
+
}
|
|
61
|
+
if (execPath.includes('/node_modules/.bin'))
|
|
62
|
+
return 'project-local';
|
|
63
|
+
return 'unknown';
|
|
64
|
+
}
|
|
65
|
+
function detectChannel(currentVersion) {
|
|
66
|
+
const { preRelease } = parseVersion(currentVersion);
|
|
67
|
+
if (!preRelease)
|
|
68
|
+
return 'latest';
|
|
69
|
+
const tag = preRelease.split('.')[0].replace(/[0-9]/g, '');
|
|
70
|
+
return tag || 'latest';
|
|
71
|
+
}
|
|
72
|
+
function formatRelativeTime(checkedAtMs) {
|
|
73
|
+
if (!checkedAtMs)
|
|
74
|
+
return null;
|
|
75
|
+
return new Date(checkedAtMs).toISOString();
|
|
76
|
+
}
|
|
77
|
+
// =============================================================================
|
|
78
|
+
// SECTION GATHERERS
|
|
79
|
+
// =============================================================================
|
|
80
|
+
function gatherEnvironment(currentVersion) {
|
|
81
|
+
return {
|
|
82
|
+
cliVersion: currentVersion,
|
|
83
|
+
channel: detectChannel(currentVersion),
|
|
84
|
+
nodeVersion: process.version,
|
|
85
|
+
platform: os.platform(),
|
|
86
|
+
arch: os.arch(),
|
|
87
|
+
osRelease: os.release(),
|
|
88
|
+
installMethod: detectInstallMethod(process.execPath),
|
|
89
|
+
execPath: process.execPath,
|
|
90
|
+
configDir: CLI_CONFIG_DIR,
|
|
91
|
+
apiBase: BASE_URLS.API,
|
|
92
|
+
authBase: BASE_URLS.AUTH,
|
|
93
|
+
envOverrides: {
|
|
94
|
+
LUA_API_URL: process.env.LUA_API_URL ?? null,
|
|
95
|
+
LUA_AUTH_URL: process.env.LUA_AUTH_URL ?? null,
|
|
96
|
+
LUA_API_KEY: process.env.LUA_API_KEY ? 'set' : 'not set',
|
|
97
|
+
LUA_TELEMETRY: process.env.LUA_TELEMETRY ?? null,
|
|
98
|
+
LUA_NO_HINTS: process.env.LUA_NO_HINTS ?? null,
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
async function gatherUpdates(currentVersion) {
|
|
103
|
+
const preFetchCache = getCachedVersionCheck();
|
|
104
|
+
try {
|
|
105
|
+
const result = await isUpdateAvailable(currentVersion);
|
|
106
|
+
const postFetchCache = getCachedVersionCheck();
|
|
107
|
+
return {
|
|
108
|
+
current: currentVersion,
|
|
109
|
+
latest: result.latest,
|
|
110
|
+
available: result.available,
|
|
111
|
+
lastCheckedAt: postFetchCache ? formatRelativeTime(postFetchCache.checkedAt) : null,
|
|
112
|
+
fromCache: !!preFetchCache,
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
const postFetchCache = getCachedVersionCheck();
|
|
117
|
+
return {
|
|
118
|
+
current: currentVersion,
|
|
119
|
+
latest: postFetchCache?.latestVersion ?? null,
|
|
120
|
+
available: false,
|
|
121
|
+
lastCheckedAt: postFetchCache ? formatRelativeTime(postFetchCache.checkedAt) : null,
|
|
122
|
+
fromCache: !!preFetchCache,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
async function gatherAuth() {
|
|
127
|
+
let apiKey = null;
|
|
128
|
+
try {
|
|
129
|
+
apiKey = loadApiKey();
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
apiKey = null;
|
|
133
|
+
}
|
|
134
|
+
if (!apiKey) {
|
|
135
|
+
let serverReachable = null;
|
|
136
|
+
let reachabilityMs = null;
|
|
137
|
+
try {
|
|
138
|
+
const start = performance.now();
|
|
139
|
+
const response = await fetch(BASE_URLS.API, {
|
|
140
|
+
method: 'HEAD',
|
|
141
|
+
signal: AbortSignal.timeout(3000),
|
|
142
|
+
});
|
|
143
|
+
reachabilityMs = Math.round(performance.now() - start);
|
|
144
|
+
serverReachable = response.ok || (response.status >= 200 && response.status < 500);
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
serverReachable = false;
|
|
148
|
+
reachabilityMs = null;
|
|
149
|
+
}
|
|
150
|
+
return {
|
|
151
|
+
authenticated: false,
|
|
152
|
+
source: null,
|
|
153
|
+
email: null,
|
|
154
|
+
userId: null,
|
|
155
|
+
organizations: [],
|
|
156
|
+
serverReachable,
|
|
157
|
+
reachabilityMs,
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
const source = process.env.LUA_API_KEY ? 'env' : 'credentials file';
|
|
161
|
+
let email = null;
|
|
162
|
+
let userId = null;
|
|
163
|
+
let organizations = [];
|
|
164
|
+
let serverReachable = null;
|
|
165
|
+
let reachabilityMs = null;
|
|
166
|
+
let keyAccepted = false;
|
|
167
|
+
try {
|
|
168
|
+
const authApi = new AuthApi(BASE_URLS.API);
|
|
169
|
+
const start = performance.now();
|
|
170
|
+
const result = await authApi.checkApiKey(apiKey);
|
|
171
|
+
reachabilityMs = Math.round(performance.now() - start);
|
|
172
|
+
serverReachable = true; // got a network response (key may still be rejected)
|
|
173
|
+
if (result.success && result.data) {
|
|
174
|
+
keyAccepted = true;
|
|
175
|
+
email = result.data.email ?? null;
|
|
176
|
+
userId = result.data.uid ?? null;
|
|
177
|
+
const orgs = result.data.admin?.orgs ?? [];
|
|
178
|
+
organizations = orgs.map((o) => ({
|
|
179
|
+
id: o.id ?? o.orgId ?? '',
|
|
180
|
+
name: o.registeredName ?? o.name ?? '',
|
|
181
|
+
}));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
catch {
|
|
185
|
+
serverReachable = false; // network error — couldn't reach the server
|
|
186
|
+
}
|
|
187
|
+
return {
|
|
188
|
+
authenticated: keyAccepted,
|
|
189
|
+
source,
|
|
190
|
+
email,
|
|
191
|
+
userId,
|
|
192
|
+
organizations,
|
|
193
|
+
serverReachable,
|
|
194
|
+
reachabilityMs,
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
function gatherProject(config) {
|
|
198
|
+
if (!config) {
|
|
199
|
+
return {
|
|
200
|
+
inProject: false,
|
|
201
|
+
rootDir: null,
|
|
202
|
+
configPath: null,
|
|
203
|
+
agentId: null,
|
|
204
|
+
agentName: null,
|
|
205
|
+
manifest: { found: false, primitiveCount: 0 },
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
const rootDir = process.cwd();
|
|
209
|
+
const configPath = join(rootDir, COMPILE_FILES.LUA_SKILL_YAML);
|
|
210
|
+
const agentId = config.agent?.agentId != null ? String(config.agent.agentId) : null;
|
|
211
|
+
let agentName = null;
|
|
212
|
+
let manifestFound = false;
|
|
213
|
+
let primitiveCount = 0;
|
|
214
|
+
try {
|
|
215
|
+
agentName = getAgentName() ?? null;
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
agentName = null;
|
|
219
|
+
}
|
|
220
|
+
try {
|
|
221
|
+
const manifest = loadManifest();
|
|
222
|
+
manifestFound = true;
|
|
223
|
+
primitiveCount = manifest.primitives.filter((p) => p.kind !== PrimitiveKind.AGENT).length;
|
|
224
|
+
}
|
|
225
|
+
catch {
|
|
226
|
+
manifestFound = false;
|
|
227
|
+
}
|
|
228
|
+
return {
|
|
229
|
+
inProject: true,
|
|
230
|
+
rootDir,
|
|
231
|
+
configPath,
|
|
232
|
+
agentId,
|
|
233
|
+
agentName,
|
|
234
|
+
manifest: { found: manifestFound, primitiveCount },
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
async function gatherPrimitives(input, warnings) {
|
|
238
|
+
const { apiKey, agentId, config } = input;
|
|
239
|
+
if (!config)
|
|
240
|
+
return [];
|
|
241
|
+
const sections = [];
|
|
242
|
+
// Local items per handler (sync — read from yaml)
|
|
243
|
+
const localPerHandler = new Map();
|
|
244
|
+
for (const handler of syncableHandlers) {
|
|
245
|
+
const yamlItems = handler.getFromYaml(config);
|
|
246
|
+
const items = yamlItems.map((item) => ({
|
|
247
|
+
name: item.name,
|
|
248
|
+
version: item.version || '',
|
|
249
|
+
entityId: item[handler.yamlConfig.idField] ?? '',
|
|
250
|
+
}));
|
|
251
|
+
localPerHandler.set(handler, items);
|
|
252
|
+
}
|
|
253
|
+
// Fetch server state per handler in parallel — Promise.allSettled to isolate failures.
|
|
254
|
+
const serverPerHandler = new Map();
|
|
255
|
+
if (apiKey && agentId) {
|
|
256
|
+
const fetchResults = await Promise.allSettled(syncableHandlers.map((handler) => handler.fetchServerState(apiKey, agentId)));
|
|
257
|
+
syncableHandlers.forEach((handler, i) => {
|
|
258
|
+
const result = fetchResults[i];
|
|
259
|
+
if (result.status === 'fulfilled') {
|
|
260
|
+
if (result.value.fetchError) {
|
|
261
|
+
warnings.push(`Failed to fetch server state for ${handler.displayNamePlural}: ${result.value.fetchError}`);
|
|
262
|
+
serverPerHandler.set(handler, null);
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
serverPerHandler.set(handler, result.value.serverItems ?? []);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
warnings.push(`Failed to fetch server state for ${handler.displayNamePlural}: ${result.reason?.message ?? 'unknown error'}`);
|
|
270
|
+
serverPerHandler.set(handler, null);
|
|
271
|
+
}
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
for (const handler of syncableHandlers) {
|
|
275
|
+
const local = localPerHandler.get(handler) ?? [];
|
|
276
|
+
const serverItems = serverPerHandler.get(handler) ?? null;
|
|
277
|
+
const versioned = isVersionedHandler(handler);
|
|
278
|
+
const server = (serverItems ?? []).map((s) => ({
|
|
279
|
+
name: s.name,
|
|
280
|
+
activeVersion: versioned ? handler.getActiveVersion(s) : null,
|
|
281
|
+
active: handler.isActive?.(s) ?? true,
|
|
282
|
+
}));
|
|
283
|
+
const serverByName = new Map();
|
|
284
|
+
for (const s of serverItems ?? []) {
|
|
285
|
+
serverByName.set(s.name, s);
|
|
286
|
+
}
|
|
287
|
+
const diffs = [];
|
|
288
|
+
if (serverItems !== null) {
|
|
289
|
+
for (const item of local) {
|
|
290
|
+
const serverItem = serverByName.get(item.name);
|
|
291
|
+
const activeVersion = versioned && serverItem ? handler.getActiveVersion(serverItem) : null;
|
|
292
|
+
let status;
|
|
293
|
+
if (!versioned) {
|
|
294
|
+
// Non-versioned (MCP servers): present on server = synced, absent = not deployed
|
|
295
|
+
status = serverItem ? 'synced' : 'not deployed';
|
|
296
|
+
}
|
|
297
|
+
else if (!item.version || activeVersion === null) {
|
|
298
|
+
status = 'not deployed';
|
|
299
|
+
}
|
|
300
|
+
else {
|
|
301
|
+
const cmp = compareVersions(item.version, activeVersion);
|
|
302
|
+
if (cmp > 0)
|
|
303
|
+
status = 'ahead';
|
|
304
|
+
else if (cmp < 0)
|
|
305
|
+
status = 'behind';
|
|
306
|
+
else
|
|
307
|
+
status = 'synced';
|
|
308
|
+
}
|
|
309
|
+
diffs.push({
|
|
310
|
+
name: item.name,
|
|
311
|
+
localVersion: item.version,
|
|
312
|
+
serverVersion: activeVersion,
|
|
313
|
+
status,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
const orphans = [];
|
|
318
|
+
if (serverItems !== null) {
|
|
319
|
+
const localNames = new Set(local.map((i) => i.name));
|
|
320
|
+
const isProcessor = handler.kind === PrimitiveKind.PREPROCESSOR || handler.kind === PrimitiveKind.POSTPROCESSOR;
|
|
321
|
+
for (const s of serverItems) {
|
|
322
|
+
if (localNames.has(s.name))
|
|
323
|
+
continue;
|
|
324
|
+
if (!(handler.isActive?.(s) ?? true))
|
|
325
|
+
continue;
|
|
326
|
+
if (!handler.shouldConsiderForOrphan(s))
|
|
327
|
+
continue;
|
|
328
|
+
const flagName = `--${handler.displayName.toLowerCase().replace(/\s+/g, '-')}-name`;
|
|
329
|
+
// Some primitive types have no CLI delete command yet
|
|
330
|
+
const cleanupCommand = handler.kind !== PrimitiveKind.DEVICE_TRIGGER ? `${handler.deleteCommand} ${flagName} "${s.name}"` : '';
|
|
331
|
+
orphans.push({
|
|
332
|
+
name: s.name,
|
|
333
|
+
cleanupCommand,
|
|
334
|
+
critical: isProcessor,
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
sections.push({
|
|
339
|
+
kind: handler.kind,
|
|
340
|
+
displayName: handler.displayNamePlural,
|
|
341
|
+
local,
|
|
342
|
+
server,
|
|
343
|
+
diffs,
|
|
344
|
+
orphans,
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
return sections;
|
|
348
|
+
}
|
|
349
|
+
async function gatherPersona(apiKey, agentId) {
|
|
350
|
+
if (!apiKey || !agentId)
|
|
351
|
+
return { status: 'unknown' };
|
|
352
|
+
try {
|
|
353
|
+
const drift = await checkPersonaDrift(apiKey, agentId);
|
|
354
|
+
return { status: drift ? 'drift' : 'synced' };
|
|
355
|
+
}
|
|
356
|
+
catch {
|
|
357
|
+
return { status: 'unknown' };
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
function gatherBackup(config) {
|
|
361
|
+
if (!config)
|
|
362
|
+
return { status: 'unknown' };
|
|
363
|
+
let currentHash = null;
|
|
364
|
+
try {
|
|
365
|
+
currentHash = getCurrentProjectHash();
|
|
366
|
+
}
|
|
367
|
+
catch {
|
|
368
|
+
currentHash = null;
|
|
369
|
+
}
|
|
370
|
+
if (!currentHash)
|
|
371
|
+
return { status: 'never-compiled' };
|
|
372
|
+
try {
|
|
373
|
+
const out = isBackupOutOfSync(currentHash, config.backup);
|
|
374
|
+
return { status: out ? 'out-of-sync' : 'synced' };
|
|
375
|
+
}
|
|
376
|
+
catch {
|
|
377
|
+
return { status: 'unknown' };
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
function gatherTelemetry() {
|
|
381
|
+
const envVal = process.env.LUA_TELEMETRY;
|
|
382
|
+
const envOverride = envVal !== undefined;
|
|
383
|
+
let enabled = true;
|
|
384
|
+
if (envOverride) {
|
|
385
|
+
enabled = !['false', '0', 'off', 'no'].includes(envVal.toLowerCase());
|
|
386
|
+
}
|
|
387
|
+
else {
|
|
388
|
+
try {
|
|
389
|
+
if (existsSync(TELEMETRY_FILE)) {
|
|
390
|
+
const raw = readFileSync(TELEMETRY_FILE, 'utf8');
|
|
391
|
+
const cfg = JSON.parse(raw);
|
|
392
|
+
if (typeof cfg.enabled === 'boolean')
|
|
393
|
+
enabled = cfg.enabled;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
catch {
|
|
397
|
+
// default enabled = true
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
return { enabled, envOverride };
|
|
401
|
+
}
|
|
402
|
+
// =============================================================================
|
|
403
|
+
// HINTS
|
|
404
|
+
// =============================================================================
|
|
405
|
+
function deriveHints(report) {
|
|
406
|
+
const hints = [];
|
|
407
|
+
if (report.updates.available && report.updates.latest) {
|
|
408
|
+
hints.push({
|
|
409
|
+
command: 'lua update',
|
|
410
|
+
reason: `Upgrade lua-cli (${report.updates.current} → ${report.updates.latest})`,
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
if (!report.auth.authenticated) {
|
|
414
|
+
hints.push({
|
|
415
|
+
command: 'lua auth configure',
|
|
416
|
+
reason: 'Authenticate for full server comparison',
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
for (const section of report.primitives) {
|
|
420
|
+
for (const orphan of section.orphans) {
|
|
421
|
+
if (!orphan.cleanupCommand)
|
|
422
|
+
continue;
|
|
423
|
+
hints.push({
|
|
424
|
+
command: orphan.cleanupCommand,
|
|
425
|
+
reason: orphan.critical
|
|
426
|
+
? `Remove orphan ${section.displayName} "${orphan.name}" (causes errors)`
|
|
427
|
+
: `Remove orphan ${section.displayName} "${orphan.name}"`,
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
if (report.backup.status === 'out-of-sync') {
|
|
432
|
+
hints.push({
|
|
433
|
+
command: 'lua push backup',
|
|
434
|
+
reason: 'Sync source backup',
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
if (report.persona.status === 'drift') {
|
|
438
|
+
hints.push({
|
|
439
|
+
command: 'lua sync',
|
|
440
|
+
reason: 'Resolve persona drift',
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
return hints;
|
|
444
|
+
}
|
|
445
|
+
// =============================================================================
|
|
446
|
+
// RENDERERS
|
|
447
|
+
// =============================================================================
|
|
448
|
+
function pad(s, n) {
|
|
449
|
+
return s.length >= n ? s : s + ' '.repeat(n - s.length);
|
|
450
|
+
}
|
|
451
|
+
function printJson(report) {
|
|
452
|
+
console.log(JSON.stringify(report));
|
|
453
|
+
}
|
|
454
|
+
function printHuman(report) {
|
|
455
|
+
const lines = [];
|
|
456
|
+
lines.push('');
|
|
457
|
+
lines.push('== lua status ==');
|
|
458
|
+
lines.push('');
|
|
459
|
+
// Environment
|
|
460
|
+
const env = report.environment;
|
|
461
|
+
lines.push('Environment');
|
|
462
|
+
lines.push(` CLI version ${env.cliVersion} (channel: ${env.channel})`);
|
|
463
|
+
lines.push(` Node ${env.nodeVersion}`);
|
|
464
|
+
lines.push(` OS ${env.platform} ${env.osRelease} (${env.arch})`);
|
|
465
|
+
lines.push(` Install method ${env.installMethod}`);
|
|
466
|
+
lines.push(` Exec path ${env.execPath}`);
|
|
467
|
+
lines.push(` Config dir ${env.configDir}`);
|
|
468
|
+
lines.push(` API base ${env.apiBase}`);
|
|
469
|
+
lines.push(` Auth base ${env.authBase}`);
|
|
470
|
+
const overrides = env.envOverrides;
|
|
471
|
+
const overridesStr = [
|
|
472
|
+
`LUA_API_URL: ${overrides.LUA_API_URL ?? 'not set'}`,
|
|
473
|
+
`LUA_AUTH_URL: ${overrides.LUA_AUTH_URL ?? 'not set'}`,
|
|
474
|
+
`LUA_API_KEY: ${overrides.LUA_API_KEY}`,
|
|
475
|
+
`LUA_TELEMETRY: ${overrides.LUA_TELEMETRY ?? 'not set'}`,
|
|
476
|
+
`LUA_NO_HINTS: ${overrides.LUA_NO_HINTS ?? 'not set'}`,
|
|
477
|
+
].join(', ');
|
|
478
|
+
lines.push(` Env overrides ${overridesStr}`);
|
|
479
|
+
lines.push('');
|
|
480
|
+
// Updates
|
|
481
|
+
const u = report.updates;
|
|
482
|
+
lines.push('Updates');
|
|
483
|
+
lines.push(` Current ${u.current}`);
|
|
484
|
+
lines.push(` Latest published ${u.latest ?? 'unknown'}`);
|
|
485
|
+
lines.push(` Status ${u.available ? 'update available — run `lua update`' : 'up to date'}`);
|
|
486
|
+
if (u.lastCheckedAt) {
|
|
487
|
+
lines.push(` Last checked ${u.lastCheckedAt}${u.fromCache ? ' (cache)' : ''}`);
|
|
488
|
+
}
|
|
489
|
+
lines.push('');
|
|
490
|
+
// Auth
|
|
491
|
+
const a = report.auth;
|
|
492
|
+
lines.push('Auth');
|
|
493
|
+
if (a.source) {
|
|
494
|
+
lines.push(` Key source ${a.source}`);
|
|
495
|
+
if (a.authenticated) {
|
|
496
|
+
lines.push(` Email ${a.email ?? 'unknown'}`);
|
|
497
|
+
lines.push(` User ID ${a.userId ?? 'unknown'}`);
|
|
498
|
+
if (a.organizations.length > 0) {
|
|
499
|
+
const orgNames = a.organizations
|
|
500
|
+
.map((o) => o.name || o.id)
|
|
501
|
+
.filter(Boolean)
|
|
502
|
+
.join(', ');
|
|
503
|
+
lines.push(` Organizations ${a.organizations.length} (${orgNames})`);
|
|
504
|
+
}
|
|
505
|
+
else {
|
|
506
|
+
lines.push(` Organizations 0`);
|
|
507
|
+
}
|
|
508
|
+
lines.push(` Status authenticated${a.reachabilityMs !== null ? ` (${a.reachabilityMs}ms)` : ''}`);
|
|
509
|
+
}
|
|
510
|
+
else if (a.serverReachable) {
|
|
511
|
+
lines.push(` Status key rejected by server${a.reachabilityMs !== null ? ` (${a.reachabilityMs}ms)` : ''}`);
|
|
512
|
+
}
|
|
513
|
+
else {
|
|
514
|
+
lines.push(` Status key found, server unreachable`);
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
else {
|
|
518
|
+
lines.push(` Status no API key configured — run \`lua auth configure\``);
|
|
519
|
+
if (a.serverReachable !== null) {
|
|
520
|
+
lines.push(` Server ${a.serverReachable ? 'reachable' : 'unreachable'}${a.reachabilityMs !== null ? ` (${a.reachabilityMs}ms)` : ''}`);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
lines.push('');
|
|
524
|
+
// Project
|
|
525
|
+
const p = report.project;
|
|
526
|
+
lines.push('Project');
|
|
527
|
+
if (p.inProject) {
|
|
528
|
+
lines.push(` Path ${p.rootDir}`);
|
|
529
|
+
lines.push(` Config ${p.configPath} (found)`);
|
|
530
|
+
lines.push(` Agent ${p.agentName ?? 'unnamed'}${p.agentId ? ` (${p.agentId.substring(0, 8)})` : ''}`);
|
|
531
|
+
if (p.manifest.found) {
|
|
532
|
+
lines.push(` Manifest dist-v2/manifest.json (compiled, ${p.manifest.primitiveCount} primitives)`);
|
|
533
|
+
}
|
|
534
|
+
else {
|
|
535
|
+
lines.push(` Manifest (never compiled)`);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
else {
|
|
539
|
+
lines.push(` (not in a lua project)`);
|
|
540
|
+
}
|
|
541
|
+
lines.push('');
|
|
542
|
+
// Per-primitive sections
|
|
543
|
+
for (const section of report.primitives) {
|
|
544
|
+
const label = section.displayName.charAt(0).toUpperCase() + section.displayName.slice(1);
|
|
545
|
+
const localCount = section.local.length;
|
|
546
|
+
const serverCount = section.server.length;
|
|
547
|
+
lines.push(`${pad(label, 22)}${localCount} local ${serverCount} server`);
|
|
548
|
+
if (localCount === 0 && section.orphans.length === 0) {
|
|
549
|
+
lines.push(' (none)');
|
|
550
|
+
lines.push('');
|
|
551
|
+
continue;
|
|
552
|
+
}
|
|
553
|
+
lines.push(` ${pad('name', 22)}${pad('local', 10)}${pad('server', 10)}status`);
|
|
554
|
+
lines.push('');
|
|
555
|
+
for (const diff of section.diffs) {
|
|
556
|
+
const sv = diff.serverVersion ?? '--';
|
|
557
|
+
lines.push(` ${pad(diff.name, 22)}${pad(diff.localVersion, 10)}${pad(sv, 10)}${diff.status}`);
|
|
558
|
+
}
|
|
559
|
+
for (const orphan of section.orphans) {
|
|
560
|
+
const serverEntry = section.server.find((s) => s.name === orphan.name);
|
|
561
|
+
const sv = serverEntry?.activeVersion ?? '--';
|
|
562
|
+
lines.push(` ${pad(orphan.name, 22)}${pad('--', 10)}${pad(sv, 10)}server only${orphan.critical ? ' ⚠ causes errors' : ''}`);
|
|
563
|
+
}
|
|
564
|
+
lines.push('');
|
|
565
|
+
}
|
|
566
|
+
// Persona
|
|
567
|
+
const personaLabel = report.persona.status === 'synced'
|
|
568
|
+
? '[synced]'
|
|
569
|
+
: report.persona.status === 'drift'
|
|
570
|
+
? '[drift detected] Local differs from server'
|
|
571
|
+
: '[unknown]';
|
|
572
|
+
lines.push(`Persona ${personaLabel}`);
|
|
573
|
+
// Backup
|
|
574
|
+
const backupLabel = report.backup.status === 'synced'
|
|
575
|
+
? '[synced]'
|
|
576
|
+
: report.backup.status === 'out-of-sync'
|
|
577
|
+
? '[out of sync] Source files changed since last push'
|
|
578
|
+
: report.backup.status === 'never-compiled'
|
|
579
|
+
? '[never-compiled] Run `lua compile` first'
|
|
580
|
+
: '[unknown]';
|
|
581
|
+
lines.push(`Backup ${backupLabel}`);
|
|
582
|
+
// Telemetry
|
|
583
|
+
lines.push(`Telemetry ${report.telemetry.enabled ? 'enabled' : 'disabled'}${report.telemetry.envOverride ? ' (LUA_TELEMETRY override)' : ''}`);
|
|
584
|
+
lines.push('');
|
|
585
|
+
// Warnings
|
|
586
|
+
if (report.warnings.length > 0) {
|
|
587
|
+
lines.push('Warnings');
|
|
588
|
+
for (const w of report.warnings) {
|
|
589
|
+
lines.push(` - ${w}`);
|
|
590
|
+
}
|
|
591
|
+
lines.push('');
|
|
592
|
+
}
|
|
593
|
+
// Next steps
|
|
594
|
+
if (report.hints.length > 0) {
|
|
595
|
+
lines.push('Next steps');
|
|
596
|
+
for (const h of report.hints) {
|
|
597
|
+
lines.push(` - ${h.reason}: \`${h.command}\``);
|
|
598
|
+
}
|
|
599
|
+
lines.push('');
|
|
600
|
+
}
|
|
601
|
+
console.log(lines.join('\n'));
|
|
602
|
+
}
|
|
603
|
+
// =============================================================================
|
|
604
|
+
// ENTRY POINT
|
|
605
|
+
// =============================================================================
|
|
606
|
+
export async function statusCommand(options) {
|
|
607
|
+
return withErrorHandling(async () => {
|
|
608
|
+
const warnings = [];
|
|
609
|
+
const currentVersion = getCliVersion();
|
|
610
|
+
const environment = gatherEnvironment(currentVersion);
|
|
611
|
+
// Gather concurrent sections via allSettled — each failure becomes a warning, never aborts.
|
|
612
|
+
const [updatesResult, authResult] = await Promise.allSettled([gatherUpdates(currentVersion), gatherAuth()]);
|
|
613
|
+
const updates = updatesResult.status === 'fulfilled'
|
|
614
|
+
? updatesResult.value
|
|
615
|
+
: (() => {
|
|
616
|
+
warnings.push(`updates: ${updatesResult.reason?.message ?? 'unknown'}`);
|
|
617
|
+
return {
|
|
618
|
+
current: currentVersion,
|
|
619
|
+
latest: null,
|
|
620
|
+
available: false,
|
|
621
|
+
lastCheckedAt: null,
|
|
622
|
+
fromCache: false,
|
|
623
|
+
};
|
|
624
|
+
})();
|
|
625
|
+
const auth = authResult.status === 'fulfilled'
|
|
626
|
+
? authResult.value
|
|
627
|
+
: (() => {
|
|
628
|
+
warnings.push(`auth: ${authResult.reason?.message ?? 'unknown'}`);
|
|
629
|
+
return {
|
|
630
|
+
authenticated: false,
|
|
631
|
+
source: null,
|
|
632
|
+
email: null,
|
|
633
|
+
userId: null,
|
|
634
|
+
organizations: [],
|
|
635
|
+
serverReachable: null,
|
|
636
|
+
reachabilityMs: null,
|
|
637
|
+
};
|
|
638
|
+
})();
|
|
639
|
+
let config = null;
|
|
640
|
+
try {
|
|
641
|
+
config = readYamlConfig();
|
|
642
|
+
}
|
|
643
|
+
catch (err) {
|
|
644
|
+
warnings.push(`config: ${err?.message ?? 'unknown'}`);
|
|
645
|
+
}
|
|
646
|
+
let project;
|
|
647
|
+
try {
|
|
648
|
+
project = gatherProject(config);
|
|
649
|
+
}
|
|
650
|
+
catch (err) {
|
|
651
|
+
warnings.push(`project: ${err?.message ?? 'unknown'}`);
|
|
652
|
+
project = {
|
|
653
|
+
inProject: false,
|
|
654
|
+
rootDir: null,
|
|
655
|
+
configPath: null,
|
|
656
|
+
agentId: null,
|
|
657
|
+
agentName: null,
|
|
658
|
+
manifest: { found: false, primitiveCount: 0 },
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
const apiKey = (() => {
|
|
662
|
+
try {
|
|
663
|
+
return loadApiKey();
|
|
664
|
+
}
|
|
665
|
+
catch {
|
|
666
|
+
return null;
|
|
667
|
+
}
|
|
668
|
+
})();
|
|
669
|
+
const [primitivesResult, personaResult] = await Promise.allSettled([
|
|
670
|
+
gatherPrimitives({ apiKey, agentId: project.agentId, config }, warnings),
|
|
671
|
+
gatherPersona(apiKey, project.agentId),
|
|
672
|
+
]);
|
|
673
|
+
const primitives = primitivesResult.status === 'fulfilled'
|
|
674
|
+
? primitivesResult.value
|
|
675
|
+
: (() => {
|
|
676
|
+
warnings.push(`primitives: ${primitivesResult.reason?.message ?? 'unknown'}`);
|
|
677
|
+
return [];
|
|
678
|
+
})();
|
|
679
|
+
const persona = personaResult.status === 'fulfilled'
|
|
680
|
+
? personaResult.value
|
|
681
|
+
: (() => {
|
|
682
|
+
warnings.push(`persona: ${personaResult.reason?.message ?? 'unknown'}`);
|
|
683
|
+
return { status: 'unknown' };
|
|
684
|
+
})();
|
|
685
|
+
let backup;
|
|
686
|
+
try {
|
|
687
|
+
backup = gatherBackup(config);
|
|
688
|
+
}
|
|
689
|
+
catch (err) {
|
|
690
|
+
warnings.push(`backup: ${err?.message ?? 'unknown'}`);
|
|
691
|
+
backup = { status: 'unknown' };
|
|
692
|
+
}
|
|
693
|
+
let telemetry;
|
|
694
|
+
try {
|
|
695
|
+
telemetry = gatherTelemetry();
|
|
696
|
+
}
|
|
697
|
+
catch (err) {
|
|
698
|
+
warnings.push(`telemetry: ${err?.message ?? 'unknown'}`);
|
|
699
|
+
telemetry = { enabled: true, envOverride: false };
|
|
700
|
+
}
|
|
701
|
+
const reportNoHints = {
|
|
702
|
+
schemaVersion: 1,
|
|
703
|
+
command: 'status',
|
|
704
|
+
generatedAt: new Date().toISOString(),
|
|
705
|
+
environment,
|
|
706
|
+
updates,
|
|
707
|
+
auth,
|
|
708
|
+
project,
|
|
709
|
+
primitives,
|
|
710
|
+
persona,
|
|
711
|
+
backup,
|
|
712
|
+
telemetry,
|
|
713
|
+
warnings,
|
|
714
|
+
};
|
|
715
|
+
const hints = hintsDisabled() ? [] : deriveHints(reportNoHints);
|
|
716
|
+
const report = { ...reportNoHints, hints };
|
|
717
|
+
if (options.json) {
|
|
718
|
+
printJson(report);
|
|
719
|
+
}
|
|
720
|
+
else {
|
|
721
|
+
printHuman(report);
|
|
722
|
+
}
|
|
723
|
+
trackEvent('cli_status_completed', {
|
|
724
|
+
has_server: !!apiKey,
|
|
725
|
+
in_project: project.inProject,
|
|
726
|
+
json_mode: !!options.json,
|
|
727
|
+
sections_failed: warnings.length,
|
|
728
|
+
});
|
|
729
|
+
}, 'status');
|
|
730
|
+
}
|
|
731
|
+
//# sourceMappingURL=status.js.map
|