lua-cli 3.15.2 → 3.16.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/dist/api-exports.d.ts +5029 -698
- package/dist/api-exports.js +6509 -772
- package/dist/api-exports.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +41174 -82
- package/dist/index.js.map +1 -1
- package/dist/voice/test/index.d.ts +1217 -0
- package/dist/voice/test/index.js +386 -0
- package/dist/voice/test/index.js.map +1 -0
- package/dist/voice-exports.d.ts +40 -0
- package/dist/voice-exports.js +16 -0
- package/dist/voice-exports.js.map +1 -0
- package/docs/README.md +1 -1
- package/package.json +38 -19
- package/scripts/build-vendor.mjs +6 -3
- package/scripts/run-api-extractor.mjs +79 -0
- package/template/.gitignore +21 -0
- package/template/package.json +1 -1
- package/dist/api/agent.api.service.d.ts +0 -165
- package/dist/api/agent.api.service.d.ts.map +0 -1
- package/dist/api/agent.api.service.js +0 -207
- package/dist/api/agent.api.service.js.map +0 -1
- package/dist/api/agents.api.service.d.ts +0 -21
- package/dist/api/agents.api.service.d.ts.map +0 -1
- package/dist/api/agents.api.service.js +0 -51
- package/dist/api/agents.api.service.js.map +0 -1
- package/dist/api/ai.api.service.d.ts +0 -20
- package/dist/api/ai.api.service.d.ts.map +0 -1
- package/dist/api/ai.api.service.js +0 -40
- package/dist/api/ai.api.service.js.map +0 -1
- package/dist/api/auth.api.service.d.ts +0 -49
- package/dist/api/auth.api.service.d.ts.map +0 -1
- package/dist/api/auth.api.service.js +0 -55
- package/dist/api/auth.api.service.js.map +0 -1
- package/dist/api/backup.api.service.d.ts +0 -78
- package/dist/api/backup.api.service.d.ts.map +0 -1
- package/dist/api/backup.api.service.js +0 -115
- package/dist/api/backup.api.service.js.map +0 -1
- package/dist/api/basket.api.service.d.ts +0 -85
- package/dist/api/basket.api.service.d.ts.map +0 -1
- package/dist/api/basket.api.service.js +0 -160
- package/dist/api/basket.api.service.js.map +0 -1
- package/dist/api/cdn.api.service.d.ts +0 -21
- package/dist/api/cdn.api.service.d.ts.map +0 -1
- package/dist/api/cdn.api.service.js +0 -46
- package/dist/api/cdn.api.service.js.map +0 -1
- package/dist/api/chat.api.service.d.ts +0 -40
- package/dist/api/chat.api.service.d.ts.map +0 -1
- package/dist/api/chat.api.service.js +0 -121
- package/dist/api/chat.api.service.js.map +0 -1
- package/dist/api/credentials.d.ts +0 -25
- package/dist/api/credentials.d.ts.map +0 -1
- package/dist/api/credentials.js +0 -44
- package/dist/api/credentials.js.map +0 -1
- package/dist/api/custom.data.api.service.d.ts +0 -71
- package/dist/api/custom.data.api.service.d.ts.map +0 -1
- package/dist/api/custom.data.api.service.js +0 -126
- package/dist/api/custom.data.api.service.js.map +0 -1
- package/dist/api/developer.api.service.d.ts +0 -121
- package/dist/api/developer.api.service.d.ts.map +0 -1
- package/dist/api/developer.api.service.js +0 -162
- package/dist/api/developer.api.service.js.map +0 -1
- package/dist/api/device-trigger.api.service.d.ts +0 -136
- package/dist/api/device-trigger.api.service.d.ts.map +0 -1
- package/dist/api/device-trigger.api.service.js +0 -120
- package/dist/api/device-trigger.api.service.js.map +0 -1
- package/dist/api/device.api.service.d.ts +0 -61
- package/dist/api/device.api.service.d.ts.map +0 -1
- package/dist/api/device.api.service.js +0 -72
- package/dist/api/device.api.service.js.map +0 -1
- package/dist/api/http.client.d.ts +0 -90
- package/dist/api/http.client.d.ts.map +0 -1
- package/dist/api/http.client.js +0 -265
- package/dist/api/http.client.js.map +0 -1
- package/dist/api/job.api.service.d.ts +0 -154
- package/dist/api/job.api.service.d.ts.map +0 -1
- package/dist/api/job.api.service.js +0 -230
- package/dist/api/job.api.service.js.map +0 -1
- package/dist/api/lazy-instances.d.ts +0 -107
- package/dist/api/lazy-instances.d.ts.map +0 -1
- package/dist/api/lazy-instances.js +0 -220
- package/dist/api/lazy-instances.js.map +0 -1
- package/dist/api/logs.api.service.d.ts +0 -38
- package/dist/api/logs.api.service.d.ts.map +0 -1
- package/dist/api/logs.api.service.js +0 -50
- package/dist/api/logs.api.service.js.map +0 -1
- package/dist/api/marketplace.api.service.d.ts +0 -28
- package/dist/api/marketplace.api.service.d.ts.map +0 -1
- package/dist/api/marketplace.api.service.js +0 -112
- package/dist/api/marketplace.api.service.js.map +0 -1
- package/dist/api/order.api.service.d.ts +0 -53
- package/dist/api/order.api.service.d.ts.map +0 -1
- package/dist/api/order.api.service.js +0 -94
- package/dist/api/order.api.service.js.map +0 -1
- package/dist/api/persona.api.service.d.ts +0 -56
- package/dist/api/persona.api.service.d.ts.map +0 -1
- package/dist/api/persona.api.service.js +0 -90
- package/dist/api/persona.api.service.js.map +0 -1
- package/dist/api/postprocessor.api.service.d.ts +0 -151
- package/dist/api/postprocessor.api.service.d.ts.map +0 -1
- package/dist/api/postprocessor.api.service.js +0 -109
- package/dist/api/postprocessor.api.service.js.map +0 -1
- package/dist/api/preprocessor.api.service.d.ts +0 -155
- package/dist/api/preprocessor.api.service.d.ts.map +0 -1
- package/dist/api/preprocessor.api.service.js +0 -111
- package/dist/api/preprocessor.api.service.js.map +0 -1
- package/dist/api/products.api.service.d.ts +0 -80
- package/dist/api/products.api.service.d.ts.map +0 -1
- package/dist/api/products.api.service.js +0 -126
- package/dist/api/products.api.service.js.map +0 -1
- package/dist/api/resource.api.service.d.ts +0 -77
- package/dist/api/resource.api.service.d.ts.map +0 -1
- package/dist/api/resource.api.service.js +0 -74
- package/dist/api/resource.api.service.js.map +0 -1
- package/dist/api/skills.api.service.d.ts +0 -86
- package/dist/api/skills.api.service.d.ts.map +0 -1
- package/dist/api/skills.api.service.js +0 -112
- package/dist/api/skills.api.service.js.map +0 -1
- package/dist/api/tool.api.service.d.ts +0 -53
- package/dist/api/tool.api.service.d.ts.map +0 -1
- package/dist/api/tool.api.service.js +0 -74
- package/dist/api/tool.api.service.js.map +0 -1
- package/dist/api/unifiedto.api.service.d.ts +0 -133
- package/dist/api/unifiedto.api.service.d.ts.map +0 -1
- package/dist/api/unifiedto.api.service.js +0 -166
- package/dist/api/unifiedto.api.service.js.map +0 -1
- package/dist/api/user.data.api.service.d.ts +0 -69
- package/dist/api/user.data.api.service.d.ts.map +0 -1
- package/dist/api/user.data.api.service.js +0 -158
- package/dist/api/user.data.api.service.js.map +0 -1
- package/dist/api/webhook.api.service.d.ts +0 -163
- package/dist/api/webhook.api.service.d.ts.map +0 -1
- package/dist/api/webhook.api.service.js +0 -140
- package/dist/api/webhook.api.service.js.map +0 -1
- package/dist/api/whatsapp-templates.api.service.d.ts +0 -41
- package/dist/api/whatsapp-templates.api.service.d.ts.map +0 -1
- package/dist/api/whatsapp-templates.api.service.js +0 -79
- package/dist/api/whatsapp-templates.api.service.js.map +0 -1
- package/dist/api-exports.d.ts.map +0 -1
- package/dist/cli/command-definitions.d.ts +0 -29
- package/dist/cli/command-definitions.d.ts.map +0 -1
- package/dist/cli/command-definitions.js +0 -935
- package/dist/cli/command-definitions.js.map +0 -1
- package/dist/commands/admin.d.ts +0 -24
- package/dist/commands/admin.d.ts.map +0 -1
- package/dist/commands/admin.js +0 -44
- package/dist/commands/admin.js.map +0 -1
- package/dist/commands/agents.d.ts +0 -23
- package/dist/commands/agents.d.ts.map +0 -1
- package/dist/commands/agents.js +0 -83
- package/dist/commands/agents.js.map +0 -1
- package/dist/commands/apiKey.d.ts +0 -8
- package/dist/commands/apiKey.d.ts.map +0 -1
- package/dist/commands/apiKey.js +0 -43
- package/dist/commands/apiKey.js.map +0 -1
- package/dist/commands/channels.d.ts +0 -13
- package/dist/commands/channels.d.ts.map +0 -1
- package/dist/commands/channels.js +0 -747
- package/dist/commands/channels.js.map +0 -1
- package/dist/commands/chat-log-probe.d.ts +0 -59
- package/dist/commands/chat-log-probe.d.ts.map +0 -1
- package/dist/commands/chat-log-probe.js +0 -87
- package/dist/commands/chat-log-probe.js.map +0 -1
- package/dist/commands/chat.d.ts +0 -20
- package/dist/commands/chat.d.ts.map +0 -1
- package/dist/commands/chat.js +0 -618
- package/dist/commands/chat.js.map +0 -1
- package/dist/commands/chatClear.d.ts +0 -25
- package/dist/commands/chatClear.d.ts.map +0 -1
- package/dist/commands/chatClear.js +0 -71
- package/dist/commands/chatClear.js.map +0 -1
- package/dist/commands/compile.d.ts +0 -48
- package/dist/commands/compile.d.ts.map +0 -1
- package/dist/commands/compile.js +0 -216
- package/dist/commands/compile.js.map +0 -1
- package/dist/commands/completion.d.ts +0 -12
- package/dist/commands/completion.d.ts.map +0 -1
- package/dist/commands/completion.js +0 -211
- package/dist/commands/completion.js.map +0 -1
- package/dist/commands/configure.d.ts +0 -42
- package/dist/commands/configure.d.ts.map +0 -1
- package/dist/commands/configure.js +0 -76
- package/dist/commands/configure.js.map +0 -1
- package/dist/commands/deploy.d.ts +0 -14
- package/dist/commands/deploy.d.ts.map +0 -1
- package/dist/commands/deploy.js +0 -517
- package/dist/commands/deploy.js.map +0 -1
- package/dist/commands/destroy.d.ts +0 -8
- package/dist/commands/destroy.d.ts.map +0 -1
- package/dist/commands/destroy.js +0 -66
- package/dist/commands/destroy.js.map +0 -1
- package/dist/commands/devices.d.ts +0 -6
- package/dist/commands/devices.d.ts.map +0 -1
- package/dist/commands/devices.js +0 -265
- package/dist/commands/devices.js.map +0 -1
- package/dist/commands/docs.d.ts +0 -20
- package/dist/commands/docs.d.ts.map +0 -1
- package/dist/commands/docs.js +0 -33
- package/dist/commands/docs.js.map +0 -1
- package/dist/commands/env.d.ts +0 -34
- package/dist/commands/env.d.ts.map +0 -1
- package/dist/commands/env.js +0 -612
- package/dist/commands/env.js.map +0 -1
- package/dist/commands/evals.d.ts +0 -9
- package/dist/commands/evals.d.ts.map +0 -1
- package/dist/commands/evals.js +0 -27
- package/dist/commands/evals.js.map +0 -1
- package/dist/commands/features.d.ts +0 -13
- package/dist/commands/features.d.ts.map +0 -1
- package/dist/commands/features.js +0 -455
- package/dist/commands/features.js.map +0 -1
- package/dist/commands/governance.d.ts +0 -7
- package/dist/commands/governance.d.ts.map +0 -1
- package/dist/commands/governance.js +0 -258
- package/dist/commands/governance.js.map +0 -1
- package/dist/commands/index.d.ts +0 -38
- package/dist/commands/index.d.ts.map +0 -1
- package/dist/commands/index.js +0 -38
- package/dist/commands/index.js.map +0 -1
- package/dist/commands/init.d.ts +0 -53
- package/dist/commands/init.d.ts.map +0 -1
- package/dist/commands/init.js +0 -992
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/integrations.d.ts +0 -18
- package/dist/commands/integrations.d.ts.map +0 -1
- package/dist/commands/integrations.js +0 -2666
- package/dist/commands/integrations.js.map +0 -1
- package/dist/commands/jobs.d.ts +0 -13
- package/dist/commands/jobs.d.ts.map +0 -1
- package/dist/commands/jobs.js +0 -736
- package/dist/commands/jobs.js.map +0 -1
- package/dist/commands/log-tip.d.ts +0 -79
- package/dist/commands/log-tip.d.ts.map +0 -1
- package/dist/commands/log-tip.js +0 -83
- package/dist/commands/log-tip.js.map +0 -1
- package/dist/commands/logs.d.ts +0 -13
- package/dist/commands/logs.d.ts.map +0 -1
- package/dist/commands/logs.js +0 -486
- package/dist/commands/logs.js.map +0 -1
- package/dist/commands/marketplace.d.ts +0 -34
- package/dist/commands/marketplace.d.ts.map +0 -1
- package/dist/commands/marketplace.js +0 -2105
- package/dist/commands/marketplace.js.map +0 -1
- package/dist/commands/mcp.d.ts +0 -32
- package/dist/commands/mcp.d.ts.map +0 -1
- package/dist/commands/mcp.js +0 -395
- package/dist/commands/mcp.js.map +0 -1
- package/dist/commands/models.d.ts +0 -18
- package/dist/commands/models.d.ts.map +0 -1
- package/dist/commands/models.js +0 -207
- package/dist/commands/models.js.map +0 -1
- package/dist/commands/persona.d.ts +0 -13
- package/dist/commands/persona.d.ts.map +0 -1
- package/dist/commands/persona.js +0 -560
- package/dist/commands/persona.js.map +0 -1
- package/dist/commands/postprocessors.d.ts +0 -13
- package/dist/commands/postprocessors.d.ts.map +0 -1
- package/dist/commands/postprocessors.js +0 -558
- package/dist/commands/postprocessors.js.map +0 -1
- package/dist/commands/preprocessors.d.ts +0 -13
- package/dist/commands/preprocessors.d.ts.map +0 -1
- package/dist/commands/preprocessors.js +0 -558
- package/dist/commands/preprocessors.js.map +0 -1
- package/dist/commands/production.d.ts +0 -13
- package/dist/commands/production.d.ts.map +0 -1
- package/dist/commands/production.js +0 -588
- package/dist/commands/production.js.map +0 -1
- package/dist/commands/push-helpers.d.ts +0 -42
- package/dist/commands/push-helpers.d.ts.map +0 -1
- package/dist/commands/push-helpers.js +0 -48
- package/dist/commands/push-helpers.js.map +0 -1
- package/dist/commands/push.d.ts +0 -19
- package/dist/commands/push.d.ts.map +0 -1
- package/dist/commands/push.js +0 -1145
- package/dist/commands/push.js.map +0 -1
- package/dist/commands/pushBackup.d.ts +0 -78
- package/dist/commands/pushBackup.d.ts.map +0 -1
- package/dist/commands/pushBackup.js +0 -274
- package/dist/commands/pushBackup.js.map +0 -1
- package/dist/commands/resources.d.ts +0 -13
- package/dist/commands/resources.d.ts.map +0 -1
- package/dist/commands/resources.js +0 -377
- package/dist/commands/resources.js.map +0 -1
- package/dist/commands/skills.d.ts +0 -13
- package/dist/commands/skills.d.ts.map +0 -1
- package/dist/commands/skills.js +0 -618
- package/dist/commands/skills.js.map +0 -1
- package/dist/commands/source.d.ts +0 -72
- package/dist/commands/source.d.ts.map +0 -1
- package/dist/commands/source.js +0 -134
- package/dist/commands/source.js.map +0 -1
- package/dist/commands/status.d.ts +0 -14
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js +0 -731
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/sync.d.ts +0 -28
- package/dist/commands/sync.d.ts.map +0 -1
- package/dist/commands/sync.js +0 -802
- package/dist/commands/sync.js.map +0 -1
- package/dist/commands/telemetry.d.ts +0 -6
- package/dist/commands/telemetry.d.ts.map +0 -1
- package/dist/commands/telemetry.js +0 -42
- package/dist/commands/telemetry.js.map +0 -1
- package/dist/commands/test-output.helpers.d.ts +0 -24
- package/dist/commands/test-output.helpers.d.ts.map +0 -1
- package/dist/commands/test-output.helpers.js +0 -62
- package/dist/commands/test-output.helpers.js.map +0 -1
- package/dist/commands/test.d.ts +0 -9
- package/dist/commands/test.d.ts.map +0 -1
- package/dist/commands/test.js +0 -787
- package/dist/commands/test.js.map +0 -1
- package/dist/commands/update.d.ts +0 -14
- package/dist/commands/update.d.ts.map +0 -1
- package/dist/commands/update.js +0 -97
- package/dist/commands/update.js.map +0 -1
- package/dist/commands/webhooks.d.ts +0 -13
- package/dist/commands/webhooks.d.ts.map +0 -1
- package/dist/commands/webhooks.js +0 -691
- package/dist/commands/webhooks.js.map +0 -1
- package/dist/compiler/agent-traverser.d.ts +0 -140
- package/dist/compiler/agent-traverser.d.ts.map +0 -1
- package/dist/compiler/agent-traverser.js +0 -420
- package/dist/compiler/agent-traverser.js.map +0 -1
- package/dist/compiler/bundler.d.ts +0 -43
- package/dist/compiler/bundler.d.ts.map +0 -1
- package/dist/compiler/bundler.js +0 -188
- package/dist/compiler/bundler.js.map +0 -1
- package/dist/compiler/compiler.d.ts +0 -208
- package/dist/compiler/compiler.d.ts.map +0 -1
- package/dist/compiler/compiler.js +0 -706
- package/dist/compiler/compiler.js.map +0 -1
- package/dist/compiler/index.d.ts +0 -38
- package/dist/compiler/index.d.ts.map +0 -1
- package/dist/compiler/index.js +0 -43
- package/dist/compiler/index.js.map +0 -1
- package/dist/compiler/plugins/agent.plugin.d.ts +0 -58
- package/dist/compiler/plugins/agent.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/agent.plugin.js +0 -161
- package/dist/compiler/plugins/agent.plugin.js.map +0 -1
- package/dist/compiler/plugins/base.d.ts +0 -334
- package/dist/compiler/plugins/base.d.ts.map +0 -1
- package/dist/compiler/plugins/base.js +0 -353
- package/dist/compiler/plugins/base.js.map +0 -1
- package/dist/compiler/plugins/device-trigger.plugin.d.ts +0 -38
- package/dist/compiler/plugins/device-trigger.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/device-trigger.plugin.js +0 -107
- package/dist/compiler/plugins/device-trigger.plugin.js.map +0 -1
- package/dist/compiler/plugins/device.plugin.d.ts +0 -39
- package/dist/compiler/plugins/device.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/device.plugin.js +0 -77
- package/dist/compiler/plugins/device.plugin.js.map +0 -1
- package/dist/compiler/plugins/job.plugin.d.ts +0 -34
- package/dist/compiler/plugins/job.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/job.plugin.js +0 -108
- package/dist/compiler/plugins/job.plugin.js.map +0 -1
- package/dist/compiler/plugins/mcp-server.plugin.d.ts +0 -38
- package/dist/compiler/plugins/mcp-server.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/mcp-server.plugin.js +0 -107
- package/dist/compiler/plugins/mcp-server.plugin.js.map +0 -1
- package/dist/compiler/plugins/postprocessor.plugin.d.ts +0 -21
- package/dist/compiler/plugins/postprocessor.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/postprocessor.plugin.js +0 -36
- package/dist/compiler/plugins/postprocessor.plugin.js.map +0 -1
- package/dist/compiler/plugins/preprocessor.plugin.d.ts +0 -21
- package/dist/compiler/plugins/preprocessor.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/preprocessor.plugin.js +0 -38
- package/dist/compiler/plugins/preprocessor.plugin.js.map +0 -1
- package/dist/compiler/plugins/processor-base.d.ts +0 -17
- package/dist/compiler/plugins/processor-base.d.ts.map +0 -1
- package/dist/compiler/plugins/processor-base.js +0 -27
- package/dist/compiler/plugins/processor-base.js.map +0 -1
- package/dist/compiler/plugins/registry.d.ts +0 -62
- package/dist/compiler/plugins/registry.d.ts.map +0 -1
- package/dist/compiler/plugins/registry.js +0 -113
- package/dist/compiler/plugins/registry.js.map +0 -1
- package/dist/compiler/plugins/skill.plugin.d.ts +0 -106
- package/dist/compiler/plugins/skill.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/skill.plugin.js +0 -316
- package/dist/compiler/plugins/skill.plugin.js.map +0 -1
- package/dist/compiler/plugins/tool.plugin.d.ts +0 -69
- package/dist/compiler/plugins/tool.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/tool.plugin.js +0 -262
- package/dist/compiler/plugins/tool.plugin.js.map +0 -1
- package/dist/compiler/plugins/webhook.plugin.d.ts +0 -38
- package/dist/compiler/plugins/webhook.plugin.d.ts.map +0 -1
- package/dist/compiler/plugins/webhook.plugin.js +0 -117
- package/dist/compiler/plugins/webhook.plugin.js.map +0 -1
- package/dist/compiler/source-writer.d.ts +0 -129
- package/dist/compiler/source-writer.d.ts.map +0 -1
- package/dist/compiler/source-writer.js +0 -329
- package/dist/compiler/source-writer.js.map +0 -1
- package/dist/compiler/types.d.ts +0 -391
- package/dist/compiler/types.d.ts.map +0 -1
- package/dist/compiler/types.js +0 -30
- package/dist/compiler/types.js.map +0 -1
- package/dist/compiler/utils/ast-helpers.d.ts +0 -106
- package/dist/compiler/utils/ast-helpers.d.ts.map +0 -1
- package/dist/compiler/utils/ast-helpers.js +0 -356
- package/dist/compiler/utils/ast-helpers.js.map +0 -1
- package/dist/compiler/utils/common.d.ts +0 -38
- package/dist/compiler/utils/common.d.ts.map +0 -1
- package/dist/compiler/utils/common.js +0 -94
- package/dist/compiler/utils/common.js.map +0 -1
- package/dist/compiler/utils/file-discovery.d.ts +0 -35
- package/dist/compiler/utils/file-discovery.d.ts.map +0 -1
- package/dist/compiler/utils/file-discovery.js +0 -60
- package/dist/compiler/utils/file-discovery.js.map +0 -1
- package/dist/compiler/utils/path-resolver.d.ts +0 -83
- package/dist/compiler/utils/path-resolver.d.ts.map +0 -1
- package/dist/compiler/utils/path-resolver.js +0 -162
- package/dist/compiler/utils/path-resolver.js.map +0 -1
- package/dist/compiler/utils/reference-resolver.d.ts +0 -196
- package/dist/compiler/utils/reference-resolver.d.ts.map +0 -1
- package/dist/compiler/utils/reference-resolver.js +0 -1026
- package/dist/compiler/utils/reference-resolver.js.map +0 -1
- package/dist/compiler/utils/schema-converter.d.ts +0 -52
- package/dist/compiler/utils/schema-converter.d.ts.map +0 -1
- package/dist/compiler/utils/schema-converter.js +0 -170
- package/dist/compiler/utils/schema-converter.js.map +0 -1
- package/dist/compiler/utils/workspace.d.ts +0 -35
- package/dist/compiler/utils/workspace.d.ts.map +0 -1
- package/dist/compiler/utils/workspace.js +0 -121
- package/dist/compiler/utils/workspace.js.map +0 -1
- package/dist/config/compile.constants.d.ts +0 -75
- package/dist/config/compile.constants.d.ts.map +0 -1
- package/dist/config/compile.constants.js +0 -95
- package/dist/config/compile.constants.js.map +0 -1
- package/dist/config/constants.d.ts +0 -49
- package/dist/config/constants.d.ts.map +0 -1
- package/dist/config/constants.js +0 -69
- package/dist/config/constants.js.map +0 -1
- package/dist/errors/auth.error.d.ts +0 -34
- package/dist/errors/auth.error.d.ts.map +0 -1
- package/dist/errors/auth.error.js +0 -29
- package/dist/errors/auth.error.js.map +0 -1
- package/dist/errors/index.d.ts +0 -5
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js +0 -5
- package/dist/errors/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/instances/basket.instance.d.ts +0 -82
- package/dist/instances/basket.instance.d.ts.map +0 -1
- package/dist/instances/basket.instance.js +0 -245
- package/dist/instances/basket.instance.js.map +0 -1
- package/dist/instances/data.entry.instance.d.ts +0 -50
- package/dist/instances/data.entry.instance.d.ts.map +0 -1
- package/dist/instances/data.entry.instance.js +0 -163
- package/dist/instances/data.entry.instance.js.map +0 -1
- package/dist/instances/job.instance.d.ts +0 -133
- package/dist/instances/job.instance.d.ts.map +0 -1
- package/dist/instances/job.instance.js +0 -180
- package/dist/instances/job.instance.js.map +0 -1
- package/dist/instances/order.instance.d.ts +0 -50
- package/dist/instances/order.instance.d.ts.map +0 -1
- package/dist/instances/order.instance.js +0 -199
- package/dist/instances/order.instance.js.map +0 -1
- package/dist/instances/product.instance.d.ts +0 -43
- package/dist/instances/product.instance.d.ts.map +0 -1
- package/dist/instances/product.instance.js +0 -145
- package/dist/instances/product.instance.js.map +0 -1
- package/dist/instances/product.pagination.instance.d.ts +0 -102
- package/dist/instances/product.pagination.instance.d.ts.map +0 -1
- package/dist/instances/product.pagination.instance.js +0 -156
- package/dist/instances/product.pagination.instance.js.map +0 -1
- package/dist/instances/product.search.instance.d.ts +0 -81
- package/dist/instances/product.search.instance.d.ts.map +0 -1
- package/dist/instances/product.search.instance.js +0 -121
- package/dist/instances/product.search.instance.js.map +0 -1
- package/dist/instances/user.instance.d.ts +0 -56
- package/dist/instances/user.instance.d.ts.map +0 -1
- package/dist/instances/user.instance.js +0 -188
- package/dist/instances/user.instance.js.map +0 -1
- package/dist/interfaces/admin.d.ts +0 -64
- package/dist/interfaces/admin.d.ts.map +0 -1
- package/dist/interfaces/admin.js +0 -6
- package/dist/interfaces/admin.js.map +0 -1
- package/dist/interfaces/agent.d.ts +0 -399
- package/dist/interfaces/agent.d.ts.map +0 -1
- package/dist/interfaces/agent.js +0 -6
- package/dist/interfaces/agent.js.map +0 -1
- package/dist/interfaces/backup.d.ts +0 -143
- package/dist/interfaces/backup.d.ts.map +0 -1
- package/dist/interfaces/backup.js +0 -8
- package/dist/interfaces/backup.js.map +0 -1
- package/dist/interfaces/baskets.d.ts +0 -80
- package/dist/interfaces/baskets.d.ts.map +0 -1
- package/dist/interfaces/baskets.js +0 -20
- package/dist/interfaces/baskets.js.map +0 -1
- package/dist/interfaces/cdn.d.ts +0 -25
- package/dist/interfaces/cdn.d.ts.map +0 -1
- package/dist/interfaces/cdn.js +0 -6
- package/dist/interfaces/cdn.js.map +0 -1
- package/dist/interfaces/chat.d.ts +0 -98
- package/dist/interfaces/chat.d.ts.map +0 -1
- package/dist/interfaces/chat.js +0 -6
- package/dist/interfaces/chat.js.map +0 -1
- package/dist/interfaces/common.d.ts +0 -64
- package/dist/interfaces/common.d.ts.map +0 -1
- package/dist/interfaces/common.js +0 -9
- package/dist/interfaces/common.js.map +0 -1
- package/dist/interfaces/custom.data.d.ts +0 -83
- package/dist/interfaces/custom.data.d.ts.map +0 -1
- package/dist/interfaces/custom.data.js +0 -6
- package/dist/interfaces/custom.data.js.map +0 -1
- package/dist/interfaces/deploy.d.ts +0 -15
- package/dist/interfaces/deploy.d.ts.map +0 -1
- package/dist/interfaces/deploy.js +0 -5
- package/dist/interfaces/deploy.js.map +0 -1
- package/dist/interfaces/dev.d.ts +0 -54
- package/dist/interfaces/dev.d.ts.map +0 -1
- package/dist/interfaces/dev.js +0 -6
- package/dist/interfaces/dev.js.map +0 -1
- package/dist/interfaces/device-triggers.d.ts +0 -80
- package/dist/interfaces/device-triggers.d.ts.map +0 -1
- package/dist/interfaces/device-triggers.js +0 -6
- package/dist/interfaces/device-triggers.js.map +0 -1
- package/dist/interfaces/devices.d.ts +0 -74
- package/dist/interfaces/devices.d.ts.map +0 -1
- package/dist/interfaces/devices.js +0 -5
- package/dist/interfaces/devices.js.map +0 -1
- package/dist/interfaces/index.d.ts +0 -15
- package/dist/interfaces/index.d.ts.map +0 -1
- package/dist/interfaces/index.js +0 -8
- package/dist/interfaces/index.js.map +0 -1
- package/dist/interfaces/init.d.ts +0 -42
- package/dist/interfaces/init.d.ts.map +0 -1
- package/dist/interfaces/init.js +0 -5
- package/dist/interfaces/init.js.map +0 -1
- package/dist/interfaces/jobs.d.ts +0 -149
- package/dist/interfaces/jobs.d.ts.map +0 -1
- package/dist/interfaces/jobs.js +0 -6
- package/dist/interfaces/jobs.js.map +0 -1
- package/dist/interfaces/logs.d.ts +0 -44
- package/dist/interfaces/logs.d.ts.map +0 -1
- package/dist/interfaces/logs.js +0 -6
- package/dist/interfaces/logs.js.map +0 -1
- package/dist/interfaces/lua.d.ts +0 -37
- package/dist/interfaces/lua.d.ts.map +0 -1
- package/dist/interfaces/lua.js +0 -6
- package/dist/interfaces/lua.js.map +0 -1
- package/dist/interfaces/marketplace.d.ts +0 -171
- package/dist/interfaces/marketplace.d.ts.map +0 -1
- package/dist/interfaces/marketplace.js +0 -3
- package/dist/interfaces/marketplace.js.map +0 -1
- package/dist/interfaces/mcp.d.ts +0 -96
- package/dist/interfaces/mcp.d.ts.map +0 -1
- package/dist/interfaces/mcp.js +0 -9
- package/dist/interfaces/mcp.js.map +0 -1
- package/dist/interfaces/message.d.ts +0 -16
- package/dist/interfaces/message.d.ts.map +0 -1
- package/dist/interfaces/message.js +0 -2
- package/dist/interfaces/message.js.map +0 -1
- package/dist/interfaces/orders.d.ts +0 -68
- package/dist/interfaces/orders.d.ts.map +0 -1
- package/dist/interfaces/orders.js +0 -20
- package/dist/interfaces/orders.js.map +0 -1
- package/dist/interfaces/persona.d.ts +0 -44
- package/dist/interfaces/persona.d.ts.map +0 -1
- package/dist/interfaces/persona.js +0 -6
- package/dist/interfaces/persona.js.map +0 -1
- package/dist/interfaces/postprocessors.d.ts +0 -15
- package/dist/interfaces/postprocessors.d.ts.map +0 -1
- package/dist/interfaces/postprocessors.js +0 -5
- package/dist/interfaces/postprocessors.js.map +0 -1
- package/dist/interfaces/preprocessors.d.ts +0 -15
- package/dist/interfaces/preprocessors.d.ts.map +0 -1
- package/dist/interfaces/preprocessors.js +0 -5
- package/dist/interfaces/preprocessors.js.map +0 -1
- package/dist/interfaces/product.d.ts +0 -92
- package/dist/interfaces/product.d.ts.map +0 -1
- package/dist/interfaces/product.js +0 -6
- package/dist/interfaces/product.js.map +0 -1
- package/dist/interfaces/push.d.ts +0 -27
- package/dist/interfaces/push.d.ts.map +0 -1
- package/dist/interfaces/push.js +0 -5
- package/dist/interfaces/push.js.map +0 -1
- package/dist/interfaces/skills.d.ts +0 -137
- package/dist/interfaces/skills.d.ts.map +0 -1
- package/dist/interfaces/skills.js +0 -6
- package/dist/interfaces/skills.js.map +0 -1
- package/dist/interfaces/test.d.ts +0 -37
- package/dist/interfaces/test.d.ts.map +0 -1
- package/dist/interfaces/test.js +0 -5
- package/dist/interfaces/test.js.map +0 -1
- package/dist/interfaces/unifiedto.d.ts +0 -141
- package/dist/interfaces/unifiedto.d.ts.map +0 -1
- package/dist/interfaces/unifiedto.js +0 -6
- package/dist/interfaces/unifiedto.js.map +0 -1
- package/dist/interfaces/user.d.ts +0 -75
- package/dist/interfaces/user.d.ts.map +0 -1
- package/dist/interfaces/user.js +0 -2
- package/dist/interfaces/user.js.map +0 -1
- package/dist/interfaces/webhooks.d.ts +0 -97
- package/dist/interfaces/webhooks.d.ts.map +0 -1
- package/dist/interfaces/webhooks.js +0 -6
- package/dist/interfaces/webhooks.js.map +0 -1
- package/dist/interfaces/whatsapp-templates.d.ts +0 -105
- package/dist/interfaces/whatsapp-templates.d.ts.map +0 -1
- package/dist/interfaces/whatsapp-templates.js +0 -6
- package/dist/interfaces/whatsapp-templates.js.map +0 -1
- package/dist/primitives/agent.handler.d.ts +0 -71
- package/dist/primitives/agent.handler.d.ts.map +0 -1
- package/dist/primitives/agent.handler.js +0 -226
- package/dist/primitives/agent.handler.js.map +0 -1
- package/dist/primitives/base.handler.d.ts +0 -229
- package/dist/primitives/base.handler.d.ts.map +0 -1
- package/dist/primitives/base.handler.js +0 -620
- package/dist/primitives/base.handler.js.map +0 -1
- package/dist/primitives/device-trigger.handler.d.ts +0 -56
- package/dist/primitives/device-trigger.handler.d.ts.map +0 -1
- package/dist/primitives/device-trigger.handler.js +0 -99
- package/dist/primitives/device-trigger.handler.js.map +0 -1
- package/dist/primitives/device.handler.d.ts +0 -57
- package/dist/primitives/device.handler.d.ts.map +0 -1
- package/dist/primitives/device.handler.js +0 -103
- package/dist/primitives/device.handler.js.map +0 -1
- package/dist/primitives/index.d.ts +0 -51
- package/dist/primitives/index.d.ts.map +0 -1
- package/dist/primitives/index.js +0 -75
- package/dist/primitives/index.js.map +0 -1
- package/dist/primitives/job.handler.d.ts +0 -53
- package/dist/primitives/job.handler.d.ts.map +0 -1
- package/dist/primitives/job.handler.js +0 -110
- package/dist/primitives/job.handler.js.map +0 -1
- package/dist/primitives/mcp-server.handler.d.ts +0 -93
- package/dist/primitives/mcp-server.handler.d.ts.map +0 -1
- package/dist/primitives/mcp-server.handler.js +0 -216
- package/dist/primitives/mcp-server.handler.js.map +0 -1
- package/dist/primitives/postprocessor.handler.d.ts +0 -44
- package/dist/primitives/postprocessor.handler.d.ts.map +0 -1
- package/dist/primitives/postprocessor.handler.js +0 -71
- package/dist/primitives/postprocessor.handler.js.map +0 -1
- package/dist/primitives/preprocessor.handler.d.ts +0 -44
- package/dist/primitives/preprocessor.handler.d.ts.map +0 -1
- package/dist/primitives/preprocessor.handler.js +0 -72
- package/dist/primitives/preprocessor.handler.js.map +0 -1
- package/dist/primitives/skill.handler.d.ts +0 -47
- package/dist/primitives/skill.handler.d.ts.map +0 -1
- package/dist/primitives/skill.handler.js +0 -229
- package/dist/primitives/skill.handler.js.map +0 -1
- package/dist/primitives/types.d.ts +0 -91
- package/dist/primitives/types.d.ts.map +0 -1
- package/dist/primitives/types.js +0 -17
- package/dist/primitives/types.js.map +0 -1
- package/dist/primitives/webhook.handler.d.ts +0 -47
- package/dist/primitives/webhook.handler.d.ts.map +0 -1
- package/dist/primitives/webhook.handler.js +0 -87
- package/dist/primitives/webhook.handler.js.map +0 -1
- package/dist/services/analytics.d.ts +0 -57
- package/dist/services/analytics.d.ts.map +0 -1
- package/dist/services/analytics.js +0 -317
- package/dist/services/analytics.js.map +0 -1
- package/dist/services/auth.d.ts +0 -72
- package/dist/services/auth.d.ts.map +0 -1
- package/dist/services/auth.js +0 -173
- package/dist/services/auth.js.map +0 -1
- package/dist/services/sandbox.service.d.ts +0 -105
- package/dist/services/sandbox.service.d.ts.map +0 -1
- package/dist/services/sandbox.service.js +0 -531
- package/dist/services/sandbox.service.js.map +0 -1
- package/dist/types/api-contracts.d.ts +0 -287
- package/dist/types/api-contracts.d.ts.map +0 -1
- package/dist/types/api-contracts.js +0 -2
- package/dist/types/api-contracts.js.map +0 -1
- package/dist/types/index.d.ts +0 -28
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -30
- package/dist/types/index.js.map +0 -1
- package/dist/types/skill.d.ts +0 -1079
- package/dist/types/skill.d.ts.map +0 -1
- package/dist/types/skill.js +0 -688
- package/dist/types/skill.js.map +0 -1
- package/dist/types/tool-validation.d.ts +0 -35
- package/dist/types/tool-validation.d.ts.map +0 -1
- package/dist/types/tool-validation.js +0 -43
- package/dist/types/tool-validation.js.map +0 -1
- package/dist/types/yaml.types.d.ts +0 -91
- package/dist/types/yaml.types.d.ts.map +0 -1
- package/dist/types/yaml.types.js +0 -5
- package/dist/types/yaml.types.js.map +0 -1
- package/dist/utils/aliases.d.ts +0 -7
- package/dist/utils/aliases.d.ts.map +0 -1
- package/dist/utils/aliases.js +0 -492
- package/dist/utils/aliases.js.map +0 -1
- package/dist/utils/artifact-loader.d.ts +0 -152
- package/dist/utils/artifact-loader.d.ts.map +0 -1
- package/dist/utils/artifact-loader.js +0 -284
- package/dist/utils/artifact-loader.js.map +0 -1
- package/dist/utils/auth-flows.d.ts +0 -55
- package/dist/utils/auth-flows.d.ts.map +0 -1
- package/dist/utils/auth-flows.js +0 -246
- package/dist/utils/auth-flows.js.map +0 -1
- package/dist/utils/backup-helpers.d.ts +0 -290
- package/dist/utils/backup-helpers.d.ts.map +0 -1
- package/dist/utils/backup-helpers.js +0 -827
- package/dist/utils/backup-helpers.js.map +0 -1
- package/dist/utils/build-manifest-from-disk.d.ts +0 -17
- package/dist/utils/build-manifest-from-disk.d.ts.map +0 -1
- package/dist/utils/build-manifest-from-disk.js +0 -111
- package/dist/utils/build-manifest-from-disk.js.map +0 -1
- package/dist/utils/bundle-upload.d.ts +0 -42
- package/dist/utils/bundle-upload.d.ts.map +0 -1
- package/dist/utils/bundle-upload.js +0 -90
- package/dist/utils/bundle-upload.js.map +0 -1
- package/dist/utils/chat-attachments.d.ts +0 -15
- package/dist/utils/chat-attachments.d.ts.map +0 -1
- package/dist/utils/chat-attachments.js +0 -116
- package/dist/utils/chat-attachments.js.map +0 -1
- package/dist/utils/cli.d.ts +0 -62
- package/dist/utils/cli.d.ts.map +0 -1
- package/dist/utils/cli.js +0 -198
- package/dist/utils/cli.js.map +0 -1
- package/dist/utils/command-utils.d.ts +0 -46
- package/dist/utils/command-utils.d.ts.map +0 -1
- package/dist/utils/command-utils.js +0 -74
- package/dist/utils/command-utils.js.map +0 -1
- package/dist/utils/deploy-helpers.d.ts +0 -40
- package/dist/utils/deploy-helpers.d.ts.map +0 -1
- package/dist/utils/deploy-helpers.js +0 -76
- package/dist/utils/deploy-helpers.js.map +0 -1
- package/dist/utils/env-loader.utils.d.ts +0 -19
- package/dist/utils/env-loader.utils.d.ts.map +0 -1
- package/dist/utils/env-loader.utils.js +0 -90
- package/dist/utils/env-loader.utils.js.map +0 -1
- package/dist/utils/files.d.ts +0 -65
- package/dist/utils/files.d.ts.map +0 -1
- package/dist/utils/files.js +0 -193
- package/dist/utils/files.js.map +0 -1
- package/dist/utils/hints.d.ts +0 -81
- package/dist/utils/hints.d.ts.map +0 -1
- package/dist/utils/hints.js +0 -81
- package/dist/utils/hints.js.map +0 -1
- package/dist/utils/init-agent.d.ts +0 -86
- package/dist/utils/init-agent.d.ts.map +0 -1
- package/dist/utils/init-agent.js +0 -201
- package/dist/utils/init-agent.js.map +0 -1
- package/dist/utils/init-helpers.d.ts +0 -37
- package/dist/utils/init-helpers.d.ts.map +0 -1
- package/dist/utils/init-helpers.js +0 -78
- package/dist/utils/init-helpers.js.map +0 -1
- package/dist/utils/init-prompts.d.ts +0 -74
- package/dist/utils/init-prompts.d.ts.map +0 -1
- package/dist/utils/init-prompts.js +0 -256
- package/dist/utils/init-prompts.js.map +0 -1
- package/dist/utils/prompt-handler.d.ts +0 -17
- package/dist/utils/prompt-handler.d.ts.map +0 -1
- package/dist/utils/prompt-handler.js +0 -49
- package/dist/utils/prompt-handler.js.map +0 -1
- package/dist/utils/sandbox-storage.d.ts +0 -83
- package/dist/utils/sandbox-storage.d.ts.map +0 -1
- package/dist/utils/sandbox-storage.js +0 -211
- package/dist/utils/sandbox-storage.js.map +0 -1
- package/dist/utils/sandbox.d.ts +0 -76
- package/dist/utils/sandbox.d.ts.map +0 -1
- package/dist/utils/sandbox.js +0 -664
- package/dist/utils/sandbox.js.map +0 -1
- package/dist/utils/semver.d.ts +0 -40
- package/dist/utils/semver.d.ts.map +0 -1
- package/dist/utils/semver.js +0 -99
- package/dist/utils/semver.js.map +0 -1
- package/dist/utils/suggest.d.ts +0 -3
- package/dist/utils/suggest.d.ts.map +0 -1
- package/dist/utils/suggest.js +0 -32
- package/dist/utils/suggest.js.map +0 -1
- package/dist/utils/sync-display.d.ts +0 -28
- package/dist/utils/sync-display.d.ts.map +0 -1
- package/dist/utils/sync-display.js +0 -168
- package/dist/utils/sync-display.js.map +0 -1
- package/dist/utils/sync-fetch.d.ts +0 -108
- package/dist/utils/sync-fetch.d.ts.map +0 -1
- package/dist/utils/sync-fetch.js +0 -294
- package/dist/utils/sync-fetch.js.map +0 -1
- package/dist/utils/sync-helpers.d.ts +0 -7
- package/dist/utils/sync-helpers.d.ts.map +0 -1
- package/dist/utils/sync-helpers.js +0 -7
- package/dist/utils/sync-helpers.js.map +0 -1
- package/dist/utils/version-check.d.ts +0 -37
- package/dist/utils/version-check.d.ts.map +0 -1
- package/dist/utils/version-check.js +0 -117
- package/dist/utils/version-check.js.map +0 -1
- package/dist/utils/write-info.d.ts +0 -9
- package/dist/utils/write-info.d.ts.map +0 -1
- package/dist/utils/write-info.js +0 -11
- package/dist/utils/write-info.js.map +0 -1
- package/node_modules/@lua/shared-types/dist/index.d.mts +0 -606
- package/node_modules/@lua/shared-types/dist/index.d.ts +0 -606
- package/node_modules/@lua/shared-types/dist/index.js +0 -435
- package/node_modules/@lua/shared-types/dist/index.mjs +0 -394
- package/node_modules/@lua/shared-types/package.json +0 -26
- package/node_modules/@lua/shared-types/src/agent-config.types.ts +0 -45
- package/node_modules/@lua/shared-types/src/agent-invocation.types.ts +0 -73
- package/node_modules/@lua/shared-types/src/ai-generate.types.ts +0 -74
- package/node_modules/@lua/shared-types/src/ai-generate.utils.ts +0 -16
- package/node_modules/@lua/shared-types/src/channel.type.ts +0 -23
- package/node_modules/@lua/shared-types/src/chat-history.types.ts +0 -112
- package/node_modules/@lua/shared-types/src/chat-stream.types.ts +0 -11
- package/node_modules/@lua/shared-types/src/client-tools.types.ts +0 -47
- package/node_modules/@lua/shared-types/src/device.types.ts +0 -190
- package/node_modules/@lua/shared-types/src/index.ts +0 -15
- package/node_modules/@lua/shared-types/src/model-registry.ts +0 -20
- package/node_modules/@lua/shared-types/src/persona-defaults.ts +0 -59
- package/node_modules/@lua/shared-types/src/persona-text.type.ts +0 -92
- package/node_modules/@lua/shared-types/src/sandbox-contract.ts +0 -63
- package/node_modules/@lua/shared-types/src/unstructured-types.ts +0 -58
- package/node_modules/@lua/shared-types/src/vm-execution-log.types.ts +0 -41
- package/node_modules/@lua/shared-types/tsconfig.json +0 -12
- package/node_modules/@lua/shared-types/tsup.config.ts +0 -9
- package/scripts/resolve-workspace-deps.cjs +0 -61
- /package/dist/{compiler/utils/zod-runtime.mjs → zod-runtime.mjs} +0 -0
package/dist/commands/push.js
DELETED
|
@@ -1,1145 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Push Command
|
|
3
|
-
* Orchestrates pushing skill versions to the server
|
|
4
|
-
*/
|
|
5
|
-
import { hasPersonaTextContent, flattenPersonaTextAll } from '@lua/shared-types';
|
|
6
|
-
import { compileCommand } from './compile.js';
|
|
7
|
-
import { readYamlConfig } from '../utils/files.js';
|
|
8
|
-
import { withErrorHandling, writeProgress, writeSuccess, writeInfo, writeError, clearPromptLines, writeNextStep, writeHintBlock, writeTip, } from '../utils/cli.js';
|
|
9
|
-
import { requireAuthOrExit } from '../utils/command-utils.js';
|
|
10
|
-
import { safePrompt } from '../utils/prompt-handler.js';
|
|
11
|
-
import { incrementPatchVersion, maxSemver } from '../utils/semver.js';
|
|
12
|
-
import { AuthenticationError } from '../errors/auth.error.js';
|
|
13
|
-
import { BASE_URLS } from '../config/constants.js';
|
|
14
|
-
import PersonaApi from '../api/persona.api.service.js';
|
|
15
|
-
import { loadManifest, getPrimitivesByKind } from '../utils/artifact-loader.js';
|
|
16
|
-
import { ensureBundlesUploaded } from '../utils/bundle-upload.js';
|
|
17
|
-
import { PrimitiveKind } from '../compiler/types.js';
|
|
18
|
-
import { agentHandler } from '../primitives/agent.handler.js';
|
|
19
|
-
import { skillHandler as skillH, webhookHandler as webhookH, jobHandler as jobH, preprocessorHandler as preprocessorH, postprocessorHandler as postprocessorH, deviceHandler as deviceH, deviceTriggerHandler as deviceTriggerH, } from '../primitives/index.js';
|
|
20
|
-
import { pushBackupCommand, runBackupPush } from './pushBackup.js';
|
|
21
|
-
import { buildLogsCommand } from './log-tip.js';
|
|
22
|
-
import { trackEvent } from '../services/analytics.js';
|
|
23
|
-
import { validateOrSuggest } from '../utils/aliases.js';
|
|
24
|
-
export { pickPushAllNextStepVariant, formatPushFailureSummary } from './push-helpers.js';
|
|
25
|
-
import { pickPushAllNextStepVariant, formatPushFailureSummary } from './push-helpers.js';
|
|
26
|
-
/**
|
|
27
|
-
* Maps push target type to a valid `lua deploy …` follow-up (or null when
|
|
28
|
-
* there is no deploy CLI surface for that type — e.g. mcp, device, backup).
|
|
29
|
-
*/
|
|
30
|
-
function getDeployHint(type) {
|
|
31
|
-
const deployableMap = {
|
|
32
|
-
skill: 'lua deploy skill',
|
|
33
|
-
webhook: 'lua deploy webhook',
|
|
34
|
-
job: 'lua deploy job',
|
|
35
|
-
preprocessor: 'lua deploy preprocessor',
|
|
36
|
-
postprocessor: 'lua deploy postprocessor',
|
|
37
|
-
agent: 'lua deploy persona',
|
|
38
|
-
persona: 'lua deploy persona',
|
|
39
|
-
};
|
|
40
|
-
const cmd = deployableMap[type];
|
|
41
|
-
if (!cmd)
|
|
42
|
-
return null;
|
|
43
|
-
return { label: 'Deploy:', command: cmd };
|
|
44
|
-
}
|
|
45
|
-
// ============================================================================
|
|
46
|
-
// Core Push Helpers (shared by all push functions)
|
|
47
|
-
// ============================================================================
|
|
48
|
-
/**
|
|
49
|
-
* Prompts user to confirm or update the version.
|
|
50
|
-
*
|
|
51
|
-
* @param currentVersion - Current version of the skill
|
|
52
|
-
* @returns Confirmed or updated version
|
|
53
|
-
*/
|
|
54
|
-
async function promptVersionConfirmOrUpdate(currentVersion) {
|
|
55
|
-
console.log(`\nCurrent version: ${currentVersion || '(none - first push)'}`);
|
|
56
|
-
const answer = await safePrompt([
|
|
57
|
-
{
|
|
58
|
-
type: 'input',
|
|
59
|
-
name: 'newVersion',
|
|
60
|
-
message: 'Enter new version to push:',
|
|
61
|
-
default: incrementPatchVersion(currentVersion),
|
|
62
|
-
validate: (input) => {
|
|
63
|
-
if (!input || input.trim() === '') {
|
|
64
|
-
return 'Version cannot be empty';
|
|
65
|
-
}
|
|
66
|
-
// Basic semver validation
|
|
67
|
-
const semverRegex = /^\d+\.\d+\.\d+(-[a-zA-Z0-9.-]+)?$/;
|
|
68
|
-
if (!semverRegex.test(input.trim())) {
|
|
69
|
-
return 'Version must follow semver format (e.g., 1.0.0, 1.0.0-alpha.1)';
|
|
70
|
-
}
|
|
71
|
-
return true;
|
|
72
|
-
},
|
|
73
|
-
},
|
|
74
|
-
]);
|
|
75
|
-
if (!answer) {
|
|
76
|
-
console.log('Push cancelled.');
|
|
77
|
-
process.exit(0);
|
|
78
|
-
}
|
|
79
|
-
clearPromptLines(2);
|
|
80
|
-
return answer.newVersion.trim();
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Authenticates the user and returns the API key
|
|
84
|
-
* Exits with error if authentication fails
|
|
85
|
-
*/
|
|
86
|
-
async function authenticateOrFail() {
|
|
87
|
-
return requireAuthOrExit(false);
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Selects an entity from a list, either by options.entityName or interactive prompt
|
|
91
|
-
* @param items - Array of items to select from
|
|
92
|
-
* @param options - Push options with entityName
|
|
93
|
-
* @param config - Configuration for selection behavior
|
|
94
|
-
*/
|
|
95
|
-
async function selectEntityOrFail(items, options, config) {
|
|
96
|
-
const { entityType, nameFields = ['id', 'name'], formatChoice } = config;
|
|
97
|
-
if (items.length === 0) {
|
|
98
|
-
throw new Error(`No ${entityType}s found in lua.skill.yaml.`);
|
|
99
|
-
}
|
|
100
|
-
// Non-interactive: find by name
|
|
101
|
-
if (options.entityName) {
|
|
102
|
-
const found = items.find((item) => nameFields.some((field) => item[field] === options.entityName));
|
|
103
|
-
if (!found) {
|
|
104
|
-
throw new Error(`${entityType} "${options.entityName}" not found`);
|
|
105
|
-
}
|
|
106
|
-
writeInfo(`📦 Selected ${entityType}: ${found.name}`);
|
|
107
|
-
return found;
|
|
108
|
-
}
|
|
109
|
-
// Single item: use it automatically
|
|
110
|
-
if (items.length === 1) {
|
|
111
|
-
writeInfo(`📦 Pushing ${entityType}: ${items[0].name}`);
|
|
112
|
-
return items[0];
|
|
113
|
-
}
|
|
114
|
-
// Multiple items: prompt for selection
|
|
115
|
-
const answer = await safePrompt([
|
|
116
|
-
{
|
|
117
|
-
type: 'list',
|
|
118
|
-
name: 'selected',
|
|
119
|
-
message: `Select a ${entityType} to push:`,
|
|
120
|
-
choices: items.map((item) => ({
|
|
121
|
-
name: formatChoice ? formatChoice(item) : `${item.name} (v${item.version})`,
|
|
122
|
-
value: item,
|
|
123
|
-
})),
|
|
124
|
-
},
|
|
125
|
-
]);
|
|
126
|
-
if (!answer) {
|
|
127
|
-
console.log('Push cancelled.');
|
|
128
|
-
process.exit(0);
|
|
129
|
-
}
|
|
130
|
-
writeInfo(`📦 Selected ${entityType}: ${answer.selected.name}`);
|
|
131
|
-
return answer.selected;
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Resolves version from options or interactive prompt
|
|
135
|
-
* Validates semantic versioning format
|
|
136
|
-
*/
|
|
137
|
-
async function resolveVersionOrFail(currentVersion, options, highestKnownVersion) {
|
|
138
|
-
// If version explicitly provided, use it
|
|
139
|
-
if (options.version) {
|
|
140
|
-
if (!/^\d+\.\d+\.\d+/.test(options.version)) {
|
|
141
|
-
throw new Error(`Invalid version format: "${options.version}". Use semantic versioning (e.g., 1.0.5)`);
|
|
142
|
-
}
|
|
143
|
-
writeInfo(`📝 Using version: ${options.version}`);
|
|
144
|
-
return options.version;
|
|
145
|
-
}
|
|
146
|
-
// If force flag provided, auto-bump without prompting
|
|
147
|
-
if (options.force) {
|
|
148
|
-
// Bump from the highest known version (max of YAML and server) to avoid conflicts
|
|
149
|
-
const baseVersion = highestKnownVersion ? maxSemver(currentVersion, highestKnownVersion) : currentVersion;
|
|
150
|
-
const newVersion = incrementPatchVersion(baseVersion);
|
|
151
|
-
writeInfo(`📝 Auto-bumping version: ${currentVersion} → ${newVersion}`);
|
|
152
|
-
return newVersion;
|
|
153
|
-
}
|
|
154
|
-
// Otherwise, prompt interactively
|
|
155
|
-
return await promptVersionConfirmOrUpdate(currentVersion);
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Determines if we should deploy after push based on options or prompt
|
|
159
|
-
*/
|
|
160
|
-
async function shouldDeployAfterPush(options) {
|
|
161
|
-
// Auto-deploy flag takes precedence
|
|
162
|
-
if (options.autoDeploy) {
|
|
163
|
-
return true;
|
|
164
|
-
}
|
|
165
|
-
// Force mode skips the prompt (no deploy)
|
|
166
|
-
if (options.force) {
|
|
167
|
-
return false;
|
|
168
|
-
}
|
|
169
|
-
// Interactive: ask user
|
|
170
|
-
const answer = await safePrompt([
|
|
171
|
-
{
|
|
172
|
-
type: 'confirm',
|
|
173
|
-
name: 'deployNow',
|
|
174
|
-
message: 'Would you like to deploy this version to production now?',
|
|
175
|
-
default: false,
|
|
176
|
-
},
|
|
177
|
-
]);
|
|
178
|
-
return answer?.deployNow || false;
|
|
179
|
-
}
|
|
180
|
-
// ============================================================================
|
|
181
|
-
// Generic Push/Deploy (replaces per-type push/deploy functions)
|
|
182
|
-
// ============================================================================
|
|
183
|
-
/**
|
|
184
|
-
* Generic push for any versioned primitive (webhook, job, preprocessor, postprocessor).
|
|
185
|
-
* Skill has its own flow due to tools array + config validation.
|
|
186
|
-
*/
|
|
187
|
-
async function pushVersionedPrimitive(handler, options = {}) {
|
|
188
|
-
try {
|
|
189
|
-
// Step 1: Compile
|
|
190
|
-
writeProgress('📦 Compiling project...');
|
|
191
|
-
await compileCommand();
|
|
192
|
-
writeSuccess('✅ Compilation complete');
|
|
193
|
-
// Step 2: Authenticate
|
|
194
|
-
const apiKey = await authenticateOrFail();
|
|
195
|
-
writeSuccess('✅ Authentication verified');
|
|
196
|
-
// Step 3: Read config
|
|
197
|
-
const config = readYamlConfig();
|
|
198
|
-
if (!config?.agent?.agentId) {
|
|
199
|
-
throw new Error("No agent ID found in lua.skill.yaml. Please run 'lua init' first.");
|
|
200
|
-
}
|
|
201
|
-
const agentId = config.agent.agentId;
|
|
202
|
-
// Step 4: Get items from YAML and select
|
|
203
|
-
const items = handler.getFromYaml(config);
|
|
204
|
-
if (items.length === 0) {
|
|
205
|
-
throw new Error(`No ${handler.displayNamePlural} found in lua.skill.yaml.`);
|
|
206
|
-
}
|
|
207
|
-
const selected = await selectEntityOrFail(items, options, {
|
|
208
|
-
entityType: handler.displayName,
|
|
209
|
-
nameFields: ['id', handler.yamlConfig.idField, 'name'],
|
|
210
|
-
});
|
|
211
|
-
const entityId = selected[handler.yamlConfig.idField];
|
|
212
|
-
if (!entityId) {
|
|
213
|
-
throw new Error(`${handler.displayName} "${selected.name}" has no server ID. Run 'lua compile' first.`);
|
|
214
|
-
}
|
|
215
|
-
// Step 5: Load bundled data — accumulate raw gzip blobs for presigned upload (BAC-196)
|
|
216
|
-
const manifest = loadManifest();
|
|
217
|
-
const bundleAccumulator = new Map();
|
|
218
|
-
const pushData = handler.prepareForPush(manifest, selected.name, undefined, bundleAccumulator);
|
|
219
|
-
if (!pushData) {
|
|
220
|
-
throw new Error(`${handler.displayName} "${selected.name}" not found in compiled output.`);
|
|
221
|
-
}
|
|
222
|
-
// Step 5b: Upload missing blobs to S3 via presigned PUT, skip ones already there.
|
|
223
|
-
let bundleStats = {
|
|
224
|
-
total: 0,
|
|
225
|
-
alreadyExisted: 0,
|
|
226
|
-
uploaded: 0,
|
|
227
|
-
};
|
|
228
|
-
if (bundleAccumulator.size > 0) {
|
|
229
|
-
writeProgress(`📤 Uploading ${bundleAccumulator.size} bundle(s) to S3...`);
|
|
230
|
-
bundleStats = await ensureBundlesUploaded(apiKey, agentId, bundleAccumulator);
|
|
231
|
-
writeSuccess('✅ Bundles uploaded');
|
|
232
|
-
}
|
|
233
|
-
// Step 6: Resolve version (check server for highest to avoid conflicts)
|
|
234
|
-
const serverHighest = options.force ? await handler.getHighestServerVersion(apiKey, agentId, entityId) : undefined;
|
|
235
|
-
const confirmedVersion = await resolveVersionOrFail(selected.version, options, serverHighest ?? undefined);
|
|
236
|
-
if (confirmedVersion !== selected.version) {
|
|
237
|
-
handler.updateVersionInYaml(selected.name, confirmedVersion);
|
|
238
|
-
}
|
|
239
|
-
// Step 7: Push
|
|
240
|
-
writeProgress(`\n🚀 Pushing ${selected.name} v${confirmedVersion} to server...`);
|
|
241
|
-
const result = await handler.pushToServer(apiKey, agentId, entityId, { ...pushData, version: confirmedVersion });
|
|
242
|
-
if (!result.success) {
|
|
243
|
-
const isVersionConflict = result.error?.toLowerCase().includes('already exists');
|
|
244
|
-
if (isVersionConflict) {
|
|
245
|
-
writeHintBlock({
|
|
246
|
-
headline: 'Version conflict — this version already exists on the server.',
|
|
247
|
-
lines: [
|
|
248
|
-
{ label: 'Auto-bump:', command: `lua push ${handler.kind} --force` },
|
|
249
|
-
{ label: 'Or push all:', command: 'lua push all --force' },
|
|
250
|
-
],
|
|
251
|
-
when: 'error',
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
// Push rejected — the reason is already on screen in the error above.
|
|
255
|
-
// No lua logs hint here: the push never ran, so no execution logs exist.
|
|
256
|
-
throw new Error(`Push Error: ${result.error || 'Unknown error'}`);
|
|
257
|
-
}
|
|
258
|
-
writeSuccess(`\n✅ Successfully pushed ${selected.name} v${confirmedVersion}\n`);
|
|
259
|
-
// Step 8: Deploy if requested
|
|
260
|
-
if (await shouldDeployAfterPush(options)) {
|
|
261
|
-
const deployedOk = await genericDeployAfterPush(handler, apiKey, agentId, entityId, selected.name, confirmedVersion, options.autoDeploy || false);
|
|
262
|
-
return { productionDeploySucceeded: deployedOk, bundleStats };
|
|
263
|
-
}
|
|
264
|
-
return { productionDeploySucceeded: false, bundleStats };
|
|
265
|
-
// Staging vs deployed hints run in pushCommand — avoid duplicates here (H8).
|
|
266
|
-
}
|
|
267
|
-
catch (error) {
|
|
268
|
-
throw error;
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
/**
|
|
272
|
-
* Generic deploy/publish after push for any versioned primitive.
|
|
273
|
-
*/
|
|
274
|
-
async function genericDeployAfterPush(handler, apiKey, agentId, entityId, entityName, version, skipConfirmation = false) {
|
|
275
|
-
try {
|
|
276
|
-
if (!skipConfirmation) {
|
|
277
|
-
console.log('\n⚠️ WARNING: You are about to deploy to PRODUCTION!');
|
|
278
|
-
console.log('⚠️ This will affect ALL users immediately.\n');
|
|
279
|
-
const confirmAnswer = await safePrompt([
|
|
280
|
-
{
|
|
281
|
-
type: 'confirm',
|
|
282
|
-
name: 'confirm',
|
|
283
|
-
message: 'Are you absolutely sure you want to deploy?',
|
|
284
|
-
default: false,
|
|
285
|
-
},
|
|
286
|
-
]);
|
|
287
|
-
if (!confirmAnswer || !confirmAnswer.confirm) {
|
|
288
|
-
console.log('\n❌ Deployment cancelled. Version pushed but not deployed.\n');
|
|
289
|
-
return false;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
writeProgress(`🔄 Publishing ${handler.displayName} version...`);
|
|
293
|
-
writeInfo('⏱️ Waiting for server to process the new version (3 seconds)...');
|
|
294
|
-
await new Promise((resolve) => setTimeout(resolve, 3000));
|
|
295
|
-
const deployed = await retryDeploy(async () => {
|
|
296
|
-
const result = await handler.publishVersion(apiKey, agentId, entityId, version);
|
|
297
|
-
if (!result.success)
|
|
298
|
-
throw new Error(result.error || 'Deploy failed');
|
|
299
|
-
}, entityName, version, 3);
|
|
300
|
-
if (!deployed) {
|
|
301
|
-
console.error(`\n❌ Deploy Error: failed after retries\n`);
|
|
302
|
-
// Deploy is a management operation — no execution logs exist for a failed deploy.
|
|
303
|
-
// Suggest retrying via the deploy command.
|
|
304
|
-
writeTip(`Deploy later with: lua deploy ${handler.kind}`);
|
|
305
|
-
return false;
|
|
306
|
-
}
|
|
307
|
-
writeSuccess(`\n✅ ${entityName} v${version} deployed to production\n`);
|
|
308
|
-
writeInfo(`💡 The new ${handler.displayName} version is now active.`);
|
|
309
|
-
return true;
|
|
310
|
-
}
|
|
311
|
-
catch (error) {
|
|
312
|
-
console.error(`\n❌ Error deploying ${handler.displayName}:`, error);
|
|
313
|
-
// Deploy is a management operation — no execution logs exist for a failed deploy.
|
|
314
|
-
writeTip(`Deploy later with: lua deploy ${handler.kind}`);
|
|
315
|
-
return false;
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
/**
|
|
319
|
-
* Main push command - pushes a primitive or agent config to the server.
|
|
320
|
-
*
|
|
321
|
-
* Supports both interactive and non-interactive modes:
|
|
322
|
-
* - Interactive: prompts user to select what to push
|
|
323
|
-
* - Non-interactive: type provided as argument (e.g., `lua push skill --name mySkill`)
|
|
324
|
-
*
|
|
325
|
-
* @param type - Optional type: 'skill', 'agent', 'persona', 'webhook', 'job', 'preprocessor', 'postprocessor', 'mcp', 'backup', or 'all'
|
|
326
|
-
* @param cmdObj - Commander command object with options
|
|
327
|
-
* @returns Promise that resolves when push completes
|
|
328
|
-
*/
|
|
329
|
-
export async function pushCommand(type, cmdObj) {
|
|
330
|
-
return withErrorHandling(async () => {
|
|
331
|
-
// Extract options from Commander command object
|
|
332
|
-
const options = {
|
|
333
|
-
force: cmdObj?.force || false,
|
|
334
|
-
autoDeploy: cmdObj?.autoDeploy || false,
|
|
335
|
-
entityName: cmdObj?.name || null,
|
|
336
|
-
version: cmdObj?.setVersion || null,
|
|
337
|
-
// Only meaningful for `lua push backup`; ignored for other types.
|
|
338
|
-
fresh: cmdObj?.fresh || false,
|
|
339
|
-
};
|
|
340
|
-
let agentOutcome;
|
|
341
|
-
let selectedType;
|
|
342
|
-
/** Present only after a versioned-primitive route; indicates production publish success after optional deploy. */
|
|
343
|
-
let versionedPushDeployResult;
|
|
344
|
-
// Normalize alias first (e.g. 'everything' → 'all', 'skills' → 'skill')
|
|
345
|
-
// so that the early 'all' guard below can catch aliases like 'everything'
|
|
346
|
-
if (type) {
|
|
347
|
-
type = validateOrSuggest('push.type', type, { allowAll: true });
|
|
348
|
-
}
|
|
349
|
-
// Handle 'all' type with force flag
|
|
350
|
-
if (type === 'all') {
|
|
351
|
-
if (!options.force) {
|
|
352
|
-
console.log('\nUsage:');
|
|
353
|
-
console.log(' lua push all --force Push all components without prompts');
|
|
354
|
-
console.log(' lua push all --force --auto-deploy Push and deploy all to production');
|
|
355
|
-
throw new Error('The "all" type requires the --force flag');
|
|
356
|
-
}
|
|
357
|
-
return await pushAllCommand(options);
|
|
358
|
-
}
|
|
359
|
-
// Validate that entityName without type is not allowed
|
|
360
|
-
if (options.entityName && !type) {
|
|
361
|
-
console.log('\nUsage:');
|
|
362
|
-
console.log(' lua push skill --name mySkill --set-version 1.0.5 Push specific skill');
|
|
363
|
-
console.log(' lua push webhook --name myWebhook --set-version 2.0.0 Push specific webhook');
|
|
364
|
-
throw new Error('Type must be specified when using the --name option.');
|
|
365
|
-
}
|
|
366
|
-
if (type) {
|
|
367
|
-
selectedType = type;
|
|
368
|
-
}
|
|
369
|
-
else {
|
|
370
|
-
// Step 2: Prompt for type selection
|
|
371
|
-
const typeAnswer = await safePrompt([
|
|
372
|
-
{
|
|
373
|
-
type: 'list',
|
|
374
|
-
name: 'type',
|
|
375
|
-
message: 'What would you like to push?',
|
|
376
|
-
choices: [
|
|
377
|
-
{ name: '🛠️ Skill', value: 'skill' },
|
|
378
|
-
{ name: '🪝 Webhook', value: 'webhook' },
|
|
379
|
-
{ name: '⏰ Job', value: 'job' },
|
|
380
|
-
{ name: '📥 PreProcessor', value: 'preprocessor' },
|
|
381
|
-
{ name: '📤 PostProcessor', value: 'postprocessor' },
|
|
382
|
-
{ name: '🔌 MCP Server', value: 'mcp' },
|
|
383
|
-
{ name: '📡 Device', value: 'device' },
|
|
384
|
-
{ name: '📡 Device Trigger', value: 'device-trigger' },
|
|
385
|
-
{ name: '🤖 Agent (persona, model)', value: 'agent' },
|
|
386
|
-
{ name: '💾 Backup (source files)', value: 'backup' },
|
|
387
|
-
],
|
|
388
|
-
},
|
|
389
|
-
]);
|
|
390
|
-
if (!typeAnswer) {
|
|
391
|
-
console.log('Push cancelled.');
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
selectedType = typeAnswer.type;
|
|
395
|
-
}
|
|
396
|
-
// Step 3: Route to appropriate function
|
|
397
|
-
if (selectedType === 'skill') {
|
|
398
|
-
versionedPushDeployResult = await pushVersionedPrimitive(skillH, options);
|
|
399
|
-
}
|
|
400
|
-
else if (selectedType === 'webhook') {
|
|
401
|
-
versionedPushDeployResult = await pushVersionedPrimitive(webhookH, options);
|
|
402
|
-
}
|
|
403
|
-
else if (selectedType === 'job') {
|
|
404
|
-
versionedPushDeployResult = await pushVersionedPrimitive(jobH, options);
|
|
405
|
-
}
|
|
406
|
-
else if (selectedType === 'preprocessor') {
|
|
407
|
-
versionedPushDeployResult = await pushVersionedPrimitive(preprocessorH, options);
|
|
408
|
-
}
|
|
409
|
-
else if (selectedType === 'postprocessor') {
|
|
410
|
-
versionedPushDeployResult = await pushVersionedPrimitive(postprocessorH, options);
|
|
411
|
-
}
|
|
412
|
-
else if (selectedType === 'device') {
|
|
413
|
-
versionedPushDeployResult = await pushVersionedPrimitive(deviceH, options);
|
|
414
|
-
}
|
|
415
|
-
else if (selectedType === 'device-trigger') {
|
|
416
|
-
versionedPushDeployResult = await pushVersionedPrimitive(deviceTriggerH, options);
|
|
417
|
-
}
|
|
418
|
-
else if (selectedType === 'mcp') {
|
|
419
|
-
const mcpActivated = await pushMCPServer(options);
|
|
420
|
-
// B10: thread activation status so the final hint knows whether MCP is live.
|
|
421
|
-
versionedPushDeployResult = { productionDeploySucceeded: mcpActivated };
|
|
422
|
-
}
|
|
423
|
-
else if (selectedType === 'backup') {
|
|
424
|
-
await pushBackupCommand({ force: options.force, fresh: options.fresh });
|
|
425
|
-
}
|
|
426
|
-
else if (selectedType === 'agent') {
|
|
427
|
-
agentOutcome = await pushAgentVersion(options);
|
|
428
|
-
}
|
|
429
|
-
if (agentOutcome?.cancelled) {
|
|
430
|
-
return;
|
|
431
|
-
}
|
|
432
|
-
// Phase 2 task 2.5: auto-backup-push after every successful primitive push.
|
|
433
|
-
// Phase 0 deleted runPostPushHook and left this gap; without it, a `lua
|
|
434
|
-
// push <X>` could exit 0 while the corresponding source backup silently
|
|
435
|
-
// never made it to S3, leaving the server-deployed code with no way to
|
|
436
|
-
// recover its source. We use runBackupPush (not pushBackupCommand) for
|
|
437
|
-
// two reasons:
|
|
438
|
-
// 1. We need it to throw on failure so the surrounding `lua push`
|
|
439
|
-
// exits non-zero — partial success here was the original failure
|
|
440
|
-
// mode this is fixing.
|
|
441
|
-
// 2. The user-facing wrapper has freshness/server-newer guards that
|
|
442
|
-
// make sense for `lua push backup` but would block the auto-hook
|
|
443
|
-
// after legitimate primitive pushes.
|
|
444
|
-
// Skip for `backup` (the user already pushed it directly) and `agent`
|
|
445
|
-
// (no source files change on the agent path).
|
|
446
|
-
if (selectedType !== 'backup' && selectedType !== 'agent') {
|
|
447
|
-
const hookApiKey = requireAuthOrExit(false);
|
|
448
|
-
const hookConfig = readYamlConfig();
|
|
449
|
-
const hookAgentId = hookConfig?.agent?.agentId;
|
|
450
|
-
if (!hookAgentId) {
|
|
451
|
-
throw new Error('Cannot run auto-backup: no agentId in lua.skill.yaml.');
|
|
452
|
-
}
|
|
453
|
-
// Source backup is a deploy invariant: a successful primitive push
|
|
454
|
-
// that doesn't reach the source store leaves `lua init` (and the
|
|
455
|
-
// Builder's workspace hydration) seeing stale state on the next
|
|
456
|
-
// restore. We exit non-zero on backup failure to surface the gap
|
|
457
|
-
// — but the primitive itself is already deployed, so the message
|
|
458
|
-
// needs to be explicit about that + point at the recovery action
|
|
459
|
-
// so the user doesn't re-push the primitive thinking it failed.
|
|
460
|
-
try {
|
|
461
|
-
const hookResult = await runBackupPush({
|
|
462
|
-
apiKey: hookApiKey,
|
|
463
|
-
agentId: hookAgentId,
|
|
464
|
-
force: true,
|
|
465
|
-
fresh: true,
|
|
466
|
-
triggeredBy: `push ${selectedType}${options.entityName ? ` ${options.entityName}` : ''}`,
|
|
467
|
-
});
|
|
468
|
-
writeInfo(`💾 Backup at v${hookResult.activeVersion} (${hookResult.filesUploaded} new file(s))`);
|
|
469
|
-
}
|
|
470
|
-
catch (err) {
|
|
471
|
-
const reason = err instanceof Error ? err.message : String(err);
|
|
472
|
-
const label = selectedType + (options.entityName ? ` "${options.entityName}"` : '');
|
|
473
|
-
writeError(`Source backup failed after ${label} push: ${reason}\n\n` +
|
|
474
|
-
`Your ${label} IS deployed and live on the server — do NOT re-push the primitive.\n` +
|
|
475
|
-
`The source backup just didn't sync. Recover with:\n\n` +
|
|
476
|
-
` lua push backup --force --fresh\n\n` +
|
|
477
|
-
`Until the backup catches up, \`lua init\` for this agent will restore an older snapshot.`);
|
|
478
|
-
throw err;
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
trackEvent('cli_push_completed', {
|
|
482
|
-
primitive_type: selectedType,
|
|
483
|
-
force_mode: options.force || false,
|
|
484
|
-
auto_deploy: options.autoDeploy || false,
|
|
485
|
-
entity_selected_by_name: !!options.entityName,
|
|
486
|
-
type_selected_by_arg: !!type,
|
|
487
|
-
version_specified: !!options.version,
|
|
488
|
-
// BAC-196 presigned-upload telemetry. `bundles_total` = unique
|
|
489
|
-
// content-hashes referenced by this push; `bundles_uploaded` = hashes
|
|
490
|
-
// the server reported missing and we PUT to S3; `bundles_existed`
|
|
491
|
-
// measures delta-upload hit rate. Zero for non-versioned types
|
|
492
|
-
// (mcp/agent/backup) — they don't go through the S3 path.
|
|
493
|
-
bundles_total: versionedPushDeployResult?.bundleStats?.total ?? 0,
|
|
494
|
-
bundles_uploaded: versionedPushDeployResult?.bundleStats?.uploaded ?? 0,
|
|
495
|
-
bundles_existed: versionedPushDeployResult?.bundleStats?.alreadyExisted ?? 0,
|
|
496
|
-
});
|
|
497
|
-
const productionDeployedActually = versionedPushDeployResult?.productionDeploySucceeded === true ||
|
|
498
|
-
(!!agentOutcome && !agentOutcome.cancelled && agentOutcome.productionDeployedWithAutoDeploy);
|
|
499
|
-
const personaAutoDeployRanAndFailed = selectedType === 'agent' &&
|
|
500
|
-
options.autoDeploy &&
|
|
501
|
-
!!agentOutcome &&
|
|
502
|
-
!agentOutcome.cancelled &&
|
|
503
|
-
'personaAutoDeployFailed' in agentOutcome &&
|
|
504
|
-
agentOutcome.personaAutoDeployFailed;
|
|
505
|
-
if (productionDeployedActually) {
|
|
506
|
-
writeHintBlock({
|
|
507
|
-
headline: 'Deployed to production. Generate test traffic first:',
|
|
508
|
-
lines: [
|
|
509
|
-
{ label: 'Test:', command: `lua chat -e production -m "your test message"` },
|
|
510
|
-
{ label: 'Inspect:', command: buildLogsCommand({ primitiveType: selectedType }) },
|
|
511
|
-
],
|
|
512
|
-
when: 'success',
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
else {
|
|
516
|
-
const deployHint = getDeployHint(selectedType);
|
|
517
|
-
if (personaAutoDeployRanAndFailed) {
|
|
518
|
-
const lines = [];
|
|
519
|
-
if (deployHint) {
|
|
520
|
-
lines.push(deployHint);
|
|
521
|
-
}
|
|
522
|
-
else if (selectedType === 'mcp') {
|
|
523
|
-
lines.push({
|
|
524
|
-
label: 'Activate:',
|
|
525
|
-
command: 'use the Lua dashboard or: lua push mcp --force --auto-deploy (requires --name when multiple MCP servers)',
|
|
526
|
-
});
|
|
527
|
-
}
|
|
528
|
-
lines.push({
|
|
529
|
-
label: 'Or re-push:',
|
|
530
|
-
command: selectedType === 'mcp'
|
|
531
|
-
? 'lua push mcp --force --auto-deploy'
|
|
532
|
-
: `lua push ${selectedType} --force --auto-deploy`,
|
|
533
|
-
});
|
|
534
|
-
writeHintBlock({
|
|
535
|
-
headline: 'Push completed — production persona deploy did not succeed. Try:',
|
|
536
|
-
lines,
|
|
537
|
-
when: 'partial',
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
|
-
else if (selectedType === 'backup') {
|
|
541
|
-
// Backup is not a "live" primitive; skip staged-vs-live framing.
|
|
542
|
-
}
|
|
543
|
-
else if (deployHint) {
|
|
544
|
-
writeHintBlock({
|
|
545
|
-
headline: 'Staged but NOT live yet. To make it active:',
|
|
546
|
-
lines: [deployHint, { label: 'Or re-push:', command: `lua push ${selectedType} --force --auto-deploy` }],
|
|
547
|
-
when: 'success',
|
|
548
|
-
});
|
|
549
|
-
}
|
|
550
|
-
else {
|
|
551
|
-
writeNextStep({
|
|
552
|
-
command: selectedType === 'mcp'
|
|
553
|
-
? 'lua push mcp --force --auto-deploy'
|
|
554
|
-
: `lua push ${selectedType} --force --auto-deploy`,
|
|
555
|
-
rationale: 'to re-push with auto-activation',
|
|
556
|
-
when: 'success',
|
|
557
|
-
});
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
}, 'push');
|
|
561
|
-
}
|
|
562
|
-
/**
|
|
563
|
-
* Push agent configuration (persona, model/modelResolver) to the server.
|
|
564
|
-
*
|
|
565
|
-
* Steps:
|
|
566
|
-
* 1. Compile to get latest manifest
|
|
567
|
-
* 2. Show preview of what will be pushed
|
|
568
|
-
* 3. Confirm (unless --force)
|
|
569
|
-
* 4. Push via agentHandler
|
|
570
|
-
* 5. Optionally deploy persona version
|
|
571
|
-
*/
|
|
572
|
-
async function pushAgentVersion(options = {}) {
|
|
573
|
-
// Step 1: Compile to get fresh manifest
|
|
574
|
-
writeProgress('🔄 Compiling...');
|
|
575
|
-
await compileCommand();
|
|
576
|
-
const config = readYamlConfig();
|
|
577
|
-
if (!config || !config.agent?.agentId) {
|
|
578
|
-
throw new Error("No agent configuration found. Please run 'lua init' first.");
|
|
579
|
-
}
|
|
580
|
-
const manifest = loadManifest();
|
|
581
|
-
const agentId = config.agent.agentId;
|
|
582
|
-
const agent = getPrimitivesByKind(manifest, PrimitiveKind.AGENT)[0];
|
|
583
|
-
const persona = agent?.persona;
|
|
584
|
-
const model = agent?.model;
|
|
585
|
-
const hasModelResolver = agent?.hasModelResolver;
|
|
586
|
-
if (!hasPersonaTextContent(persona) && !model && !hasModelResolver) {
|
|
587
|
-
throw new Error('No agent configuration to push (no persona or model found).');
|
|
588
|
-
}
|
|
589
|
-
writeInfo(`📦 Pushing agent config for: ${agentId}`);
|
|
590
|
-
// Show preview
|
|
591
|
-
if (hasPersonaTextContent(persona)) {
|
|
592
|
-
// Channel-agnostic — preview shows the full persona content regardless
|
|
593
|
-
// of which channel branches are populated.
|
|
594
|
-
const personaText = flattenPersonaTextAll(persona);
|
|
595
|
-
const preview = personaText.length > 200 ? personaText.substring(0, 200) + '...' : personaText;
|
|
596
|
-
console.log('\nPersona preview:');
|
|
597
|
-
console.log(preview);
|
|
598
|
-
}
|
|
599
|
-
if (model) {
|
|
600
|
-
console.log(`\nModel: ${model}`);
|
|
601
|
-
}
|
|
602
|
-
console.log();
|
|
603
|
-
// Confirm (skip if --force)
|
|
604
|
-
if (!options.force) {
|
|
605
|
-
const confirmAnswer = await safePrompt([
|
|
606
|
-
{
|
|
607
|
-
type: 'confirm',
|
|
608
|
-
name: 'confirm',
|
|
609
|
-
message: 'Push agent configuration to server?',
|
|
610
|
-
default: true,
|
|
611
|
-
},
|
|
612
|
-
]);
|
|
613
|
-
if (!confirmAnswer || !confirmAnswer.confirm) {
|
|
614
|
-
console.log('\n❌ Push cancelled.\n');
|
|
615
|
-
return { cancelled: true };
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
// Authenticate
|
|
619
|
-
const apiKey = await authenticateOrFail();
|
|
620
|
-
writeProgress('✅ Authenticated');
|
|
621
|
-
// Push via agentHandler
|
|
622
|
-
const result = await agentHandler.pushAgentConfig(apiKey, agentId, manifest);
|
|
623
|
-
let productionDeployedWithAutoDeploy = false;
|
|
624
|
-
let personaDeployWasAttempted = false;
|
|
625
|
-
const personaDeployEligible = !!(result.persona?.success && result.persona.version);
|
|
626
|
-
// B4: only ask about deploy when a persona was actually pushed — avoid the prompt
|
|
627
|
-
// when push failed or was a model-only push with no persona version created.
|
|
628
|
-
if (personaDeployEligible) {
|
|
629
|
-
const shouldDeploy = await shouldDeployAfterPush(options);
|
|
630
|
-
if (shouldDeploy) {
|
|
631
|
-
personaDeployWasAttempted = true;
|
|
632
|
-
productionDeployedWithAutoDeploy = await deployPersonaVersionAfterPush(apiKey, agentId, result.persona.version, options.autoDeploy || false);
|
|
633
|
-
}
|
|
634
|
-
else {
|
|
635
|
-
writeInfo('💡 You can deploy the persona version later using: lua deploy');
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
const personaAutoDeployFailed = Boolean(options.autoDeploy && personaDeployEligible && personaDeployWasAttempted && !productionDeployedWithAutoDeploy);
|
|
639
|
-
return { cancelled: false, productionDeployedWithAutoDeploy, personaAutoDeployFailed };
|
|
640
|
-
}
|
|
641
|
-
/**
|
|
642
|
-
* Deploy a persona version immediately after pushing
|
|
643
|
-
*/
|
|
644
|
-
async function deployPersonaVersionAfterPush(apiKey, agentId, versionNum, skipConfirmation = false) {
|
|
645
|
-
try {
|
|
646
|
-
// Skip confirmation when called from auto-deploy with --force
|
|
647
|
-
if (!skipConfirmation) {
|
|
648
|
-
// Show warning
|
|
649
|
-
console.log('\n⚠️ WARNING: You are about to deploy to PRODUCTION!');
|
|
650
|
-
console.log('⚠️ This will affect ALL users immediately.\n');
|
|
651
|
-
const confirmAnswer = await safePrompt([
|
|
652
|
-
{
|
|
653
|
-
type: 'confirm',
|
|
654
|
-
name: 'confirm',
|
|
655
|
-
message: 'Are you absolutely sure you want to deploy this persona version?',
|
|
656
|
-
default: false,
|
|
657
|
-
},
|
|
658
|
-
]);
|
|
659
|
-
if (!confirmAnswer || !confirmAnswer.confirm) {
|
|
660
|
-
console.log('\n❌ Deployment cancelled. Persona version created but not deployed.\n');
|
|
661
|
-
return false;
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
writeProgress('🔄 Deploying persona version...');
|
|
665
|
-
const personaApi = new PersonaApi(BASE_URLS.API, apiKey, agentId);
|
|
666
|
-
const deployResult = await personaApi.deployVersion(versionNum);
|
|
667
|
-
if (!deployResult.success) {
|
|
668
|
-
console.error(`\n❌ Deploy Error: ${deployResult.error?.message || 'Unknown error'}\n`);
|
|
669
|
-
// Persona deploy is a management operation — no execution logs exist.
|
|
670
|
-
writeTip('Retry with: lua push agent');
|
|
671
|
-
throw new Error(deployResult.error?.message || 'Failed to deploy persona version');
|
|
672
|
-
}
|
|
673
|
-
writeSuccess(`\n✅ Persona version ${versionNum} deployed successfully to production\n`);
|
|
674
|
-
writeInfo('💡 The new persona is now active for all users.');
|
|
675
|
-
return true;
|
|
676
|
-
}
|
|
677
|
-
catch (error) {
|
|
678
|
-
console.error('\n❌ Error deploying persona version:', error);
|
|
679
|
-
writeTip('Retry with: lua push agent');
|
|
680
|
-
return false;
|
|
681
|
-
}
|
|
682
|
-
}
|
|
683
|
-
/**
|
|
684
|
-
* Push MCP server (non-versioned, upsert pattern).
|
|
685
|
-
* Uses the same compile→auth→config→select pattern as versioned primitives,
|
|
686
|
-
* with MCP-specific logic delegated to the handler.
|
|
687
|
-
*/
|
|
688
|
-
async function pushMCPServer(options = {}) {
|
|
689
|
-
try {
|
|
690
|
-
writeProgress('📦 Compiling project...');
|
|
691
|
-
await compileCommand();
|
|
692
|
-
writeSuccess('✅ Compilation complete');
|
|
693
|
-
const apiKey = await authenticateOrFail();
|
|
694
|
-
writeSuccess('✅ Authentication verified');
|
|
695
|
-
const config = readYamlConfig();
|
|
696
|
-
if (!config?.agent?.agentId) {
|
|
697
|
-
throw new Error("No agent ID found. Run 'lua init' first.");
|
|
698
|
-
}
|
|
699
|
-
const agentId = config.agent.agentId;
|
|
700
|
-
const { mcpServerHandler } = await import('../primitives/mcp-server.handler.js');
|
|
701
|
-
const bundledServers = mcpServerHandler.loadBundledItems();
|
|
702
|
-
if (bundledServers.length === 0) {
|
|
703
|
-
throw new Error('No MCP servers found in compiled output.');
|
|
704
|
-
}
|
|
705
|
-
const selectedServer = await selectEntityOrFail(bundledServers, options, {
|
|
706
|
-
entityType: 'MCP server',
|
|
707
|
-
nameFields: ['name'],
|
|
708
|
-
formatChoice: (s) => `${s.name} (${s.transport})`,
|
|
709
|
-
});
|
|
710
|
-
writeProgress(`\n🚀 Pushing MCP server "${selectedServer.name}"...`);
|
|
711
|
-
// upsertOnServer persists the returned id into lua.skill.yaml on success.
|
|
712
|
-
const result = await mcpServerHandler.upsertOnServer(apiKey, agentId, selectedServer);
|
|
713
|
-
if (!result.success) {
|
|
714
|
-
// Push rejected — reason already on screen; no execution logs exist for a failed push.
|
|
715
|
-
throw new Error(`Failed: ${result.error}`);
|
|
716
|
-
}
|
|
717
|
-
writeSuccess(`\n✅ MCP server "${selectedServer.name}" pushed successfully\n`);
|
|
718
|
-
let activated = false;
|
|
719
|
-
if (result.id && (await shouldDeployAfterPush(options))) {
|
|
720
|
-
writeProgress('🔄 Activating MCP server...');
|
|
721
|
-
const activateResult = await mcpServerHandler.activate(apiKey, agentId, result.id);
|
|
722
|
-
if (activateResult.success) {
|
|
723
|
-
writeSuccess(`✅ MCP server activated\n`);
|
|
724
|
-
activated = true;
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
return activated;
|
|
728
|
-
}
|
|
729
|
-
catch (error) {
|
|
730
|
-
throw error;
|
|
731
|
-
}
|
|
732
|
-
return false; // unreachable — catch always rethrows
|
|
733
|
-
}
|
|
734
|
-
/**
|
|
735
|
-
* Push all command - Pushes all components (skills, webhooks, jobs, processors) without prompts
|
|
736
|
-
*
|
|
737
|
-
* This command:
|
|
738
|
-
* 1. Compiles the project
|
|
739
|
-
* 2. Reads lua.skill.yaml to get all components
|
|
740
|
-
* 3. Auto-bumps patch versions
|
|
741
|
-
* 4. Pushes all components
|
|
742
|
-
* 5. Optionally auto-deploys to production
|
|
743
|
-
*
|
|
744
|
-
* @param options - Command options (force is required, autoDeploy is optional)
|
|
745
|
-
*/
|
|
746
|
-
async function pushAllCommand(options) {
|
|
747
|
-
writeProgress('🚀 Push All - Pushing all components to server...\n');
|
|
748
|
-
if (options.autoDeploy) {
|
|
749
|
-
writeInfo('🚀 Auto-deploy to production is ENABLED\n');
|
|
750
|
-
}
|
|
751
|
-
// Step 1: Compile first
|
|
752
|
-
writeProgress('📦 Compiling project...');
|
|
753
|
-
await compileCommand();
|
|
754
|
-
// Step 2: Load configuration and API key
|
|
755
|
-
const config = readYamlConfig();
|
|
756
|
-
if (!config?.agent?.agentId) {
|
|
757
|
-
throw new Error('No agent ID found in lua.skill.yaml. Run "lua init" first.');
|
|
758
|
-
}
|
|
759
|
-
const apiKey = await requireAuthOrExit(false);
|
|
760
|
-
const agentId = config.agent.agentId;
|
|
761
|
-
// Step 3: Load manifest
|
|
762
|
-
let manifest;
|
|
763
|
-
try {
|
|
764
|
-
manifest = loadManifest();
|
|
765
|
-
}
|
|
766
|
-
catch (error) {
|
|
767
|
-
throw new Error(`Compilation output not found. Compilation may have failed. ${error.message}`);
|
|
768
|
-
}
|
|
769
|
-
// Track results and deploy queue per handler
|
|
770
|
-
const allResults = [];
|
|
771
|
-
const toDeploy = [];
|
|
772
|
-
// Per-item failures collected across all push surfaces (versioned
|
|
773
|
-
// primitives + MCP). Drives the post-run aggregate `⚠️ N component(s)
|
|
774
|
-
// failed` block and the final partial/error writeNextStep variant.
|
|
775
|
-
const failedItems = [];
|
|
776
|
-
let deployFailedCount = 0;
|
|
777
|
-
let personaPushResult = null;
|
|
778
|
-
let backupSuccess = false;
|
|
779
|
-
// BAC-196: aggregate bundle-upload stats across all primitives in the run.
|
|
780
|
-
const bundleStatsAggregate = { total: 0, uploaded: 0, existed: 0 };
|
|
781
|
-
// Icons per kind for display
|
|
782
|
-
const kindIcons = {
|
|
783
|
-
skill: '📦',
|
|
784
|
-
webhook: '🪝',
|
|
785
|
-
job: '⏰',
|
|
786
|
-
preprocessor: '📥',
|
|
787
|
-
postprocessor: '📤',
|
|
788
|
-
device: '📡',
|
|
789
|
-
};
|
|
790
|
-
// Step 4: Pre-fetch highest versions in parallel (one HTTP call per handler type)
|
|
791
|
-
const handlers = [
|
|
792
|
-
skillH,
|
|
793
|
-
webhookH,
|
|
794
|
-
jobH,
|
|
795
|
-
preprocessorH,
|
|
796
|
-
postprocessorH,
|
|
797
|
-
deviceH,
|
|
798
|
-
deviceTriggerH,
|
|
799
|
-
];
|
|
800
|
-
// Collect entity IDs per handler and batch-fetch versions in parallel
|
|
801
|
-
const handlerItems = handlers
|
|
802
|
-
.map((handler) => ({
|
|
803
|
-
handler,
|
|
804
|
-
items: handler.getFromYaml(config).filter((item) => {
|
|
805
|
-
const entityId = item[handler.yamlConfig.idField];
|
|
806
|
-
return entityId && item.version;
|
|
807
|
-
}),
|
|
808
|
-
}))
|
|
809
|
-
.filter((h) => h.items.length > 0);
|
|
810
|
-
const versionMaps = await Promise.all(handlerItems.map(async ({ handler, items }) => {
|
|
811
|
-
const entityIds = items.map((item) => item[handler.yamlConfig.idField]);
|
|
812
|
-
const versions = await handler.batchGetHighestVersions(apiKey, agentId, entityIds);
|
|
813
|
-
return { handler, versions };
|
|
814
|
-
}));
|
|
815
|
-
const versionLookup = new Map();
|
|
816
|
-
for (const { handler, versions } of versionMaps) {
|
|
817
|
-
versionLookup.set(handler, versions);
|
|
818
|
-
}
|
|
819
|
-
// Step 5: Push all versioned primitives (versions already pre-fetched)
|
|
820
|
-
for (const handler of handlers) {
|
|
821
|
-
const items = handler.getFromYaml(config);
|
|
822
|
-
if (items.length === 0)
|
|
823
|
-
continue;
|
|
824
|
-
const icon = kindIcons[handler.kind] || '📦';
|
|
825
|
-
writeProgress(`\n${icon} Pushing ${items.length} ${handler.displayName}(s)...`);
|
|
826
|
-
const handlerVersions = versionLookup.get(handler);
|
|
827
|
-
for (const item of items) {
|
|
828
|
-
try {
|
|
829
|
-
const bundleAccumulator = new Map();
|
|
830
|
-
const pushData = handler.prepareForPush(manifest, item.name, undefined, bundleAccumulator);
|
|
831
|
-
if (!pushData) {
|
|
832
|
-
console.warn(`⚠️ ${handler.displayName} "${item.name}" not found in compiled output, skipping`);
|
|
833
|
-
continue;
|
|
834
|
-
}
|
|
835
|
-
if (bundleAccumulator.size > 0) {
|
|
836
|
-
const stats = await ensureBundlesUploaded(apiKey, agentId, bundleAccumulator);
|
|
837
|
-
bundleStatsAggregate.total += stats.total;
|
|
838
|
-
bundleStatsAggregate.uploaded += stats.uploaded;
|
|
839
|
-
bundleStatsAggregate.existed += stats.alreadyExisted;
|
|
840
|
-
}
|
|
841
|
-
const entityId = item[handler.yamlConfig.idField];
|
|
842
|
-
if (!entityId) {
|
|
843
|
-
console.warn(`⚠️ ${handler.displayName} "${item.name}" has no server ID, skipping. Run 'lua compile' first.`);
|
|
844
|
-
continue;
|
|
845
|
-
}
|
|
846
|
-
if (!item.version) {
|
|
847
|
-
console.warn(`⚠️ ${handler.displayName} "${item.name}" has no version, skipping`);
|
|
848
|
-
continue;
|
|
849
|
-
}
|
|
850
|
-
// Auto-bump version (use pre-fetched server version to avoid conflicts)
|
|
851
|
-
const serverHighest = handlerVersions?.get(entityId) ?? null;
|
|
852
|
-
const baseVersion = serverHighest ? maxSemver(item.version, serverHighest) : item.version;
|
|
853
|
-
let newVersion = incrementPatchVersion(baseVersion);
|
|
854
|
-
writeInfo(` 📝 ${item.name}: ${item.version} → ${newVersion}`);
|
|
855
|
-
// Push
|
|
856
|
-
let result = await handler.pushToServer(apiKey, agentId, entityId, { ...pushData, version: newVersion });
|
|
857
|
-
// On version collision, re-fetch the server's current highest version
|
|
858
|
-
// and try once more. The pre-fetch in step 4 is racey against
|
|
859
|
-
// concurrent pushes by the same/another user; a single re-bump
|
|
860
|
-
// resolves the dominant collision pattern observed in production.
|
|
861
|
-
if (!result.success && result.error?.toLowerCase().includes('already exists')) {
|
|
862
|
-
console.log(` ⚠️ Version collision on ${item.name}, refetching server state and retrying...`);
|
|
863
|
-
const freshHighest = await handler.getHighestServerVersion(apiKey, agentId, entityId);
|
|
864
|
-
if (freshHighest) {
|
|
865
|
-
const retryVersion = incrementPatchVersion(freshHighest);
|
|
866
|
-
writeInfo(` 📝 ${item.name}: re-bumped ${newVersion} → ${retryVersion} after collision`);
|
|
867
|
-
result = await handler.pushToServer(apiKey, agentId, entityId, { ...pushData, version: retryVersion });
|
|
868
|
-
if (result.success) {
|
|
869
|
-
newVersion = retryVersion;
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
if (!result.success) {
|
|
874
|
-
console.error(` ❌ Failed to push ${item.name}: ${result.error}`);
|
|
875
|
-
failedItems.push({ kind: handler.kind, name: item.name, error: result.error || 'Unknown error' });
|
|
876
|
-
continue;
|
|
877
|
-
}
|
|
878
|
-
handler.updateVersionInYaml(item.name, newVersion, { silent: true });
|
|
879
|
-
allResults.push({ handler, name: item.name, version: newVersion, entityId });
|
|
880
|
-
writeSuccess(` ✅ ${item.name} v${newVersion} pushed`);
|
|
881
|
-
if (options.autoDeploy) {
|
|
882
|
-
toDeploy.push({ handler, name: item.name, version: newVersion, entityId });
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
catch (error) {
|
|
886
|
-
// Auth errors must propagate so withErrorHandling treats them as
|
|
887
|
-
// fatal, otherwise the loop continues against a known-broken auth
|
|
888
|
-
// state. Matches the re-throw pattern in batchGetHighestVersions /
|
|
889
|
-
// getHighestServerVersion.
|
|
890
|
-
if (AuthenticationError.isAuthenticationError(error))
|
|
891
|
-
throw error;
|
|
892
|
-
console.error(` ❌ Failed to push ${item.name}: ${error.message}`);
|
|
893
|
-
failedItems.push({ kind: handler.kind, name: item.name, error: error.message || 'Unknown error' });
|
|
894
|
-
}
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
// Step 6: Push MCP server configurations (non-versioned, upsert-by-name).
|
|
898
|
-
// push.ts loads bundled servers once and hands them to pushAll, which
|
|
899
|
-
// upserts each, persists returned ids into lua.skill.yaml, and activates
|
|
900
|
-
// when --auto-deploy is set. Here we only print the summary.
|
|
901
|
-
const { mcpServerHandler: mcpH } = await import('../primitives/mcp-server.handler.js');
|
|
902
|
-
const bundledMcp = mcpH.loadBundledItems();
|
|
903
|
-
let mcpPushedCount = 0; // tracks actual successes, not just attempts (B2)
|
|
904
|
-
if (bundledMcp.length > 0) {
|
|
905
|
-
writeProgress(`\n🔌 Pushing ${bundledMcp.length} MCP server(s)...`);
|
|
906
|
-
const mcpResult = await mcpH.pushAll(bundledMcp, apiKey, agentId, { autoDeploy: options.autoDeploy });
|
|
907
|
-
mcpPushedCount = mcpResult.pushed.length;
|
|
908
|
-
for (const name of mcpResult.pushed) {
|
|
909
|
-
writeSuccess(` ✅ ${name}`);
|
|
910
|
-
if (mcpResult.activated.includes(name))
|
|
911
|
-
writeSuccess(` 🔌 Auto-activated`);
|
|
912
|
-
}
|
|
913
|
-
for (const { name, error } of mcpResult.failed) {
|
|
914
|
-
console.error(` ❌ Failed to push ${name}: ${error}`);
|
|
915
|
-
failedItems.push({ kind: 'mcp', name, error: error || 'Unknown error' });
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
// Aggregate failure block: emit a single grouped summary with a per-item
|
|
919
|
-
// `lua logs` diagnose hint so users can jump straight to the failing
|
|
920
|
-
// component's logs without scrolling back through interleaved push output.
|
|
921
|
-
// Printed before agent config push so the user sees component failures
|
|
922
|
-
// alongside the persona/backup status that follows.
|
|
923
|
-
if (failedItems.length > 0) {
|
|
924
|
-
console.error(formatPushFailureSummary(failedItems));
|
|
925
|
-
}
|
|
926
|
-
// Step 6.5: Push agent config (persona, model/modelResolver)
|
|
927
|
-
const agentPushResult = await agentHandler.pushAgentConfig(apiKey, agentId, manifest);
|
|
928
|
-
if (agentPushResult.persona?.success) {
|
|
929
|
-
personaPushResult = { version: agentPushResult.persona.version };
|
|
930
|
-
}
|
|
931
|
-
// Persona push creates a new version but doesn't activate it. Without
|
|
932
|
-
// --auto-deploy the dashboard keeps showing the previously-deployed
|
|
933
|
-
// version, which is surprising since other primitives feel "live" after
|
|
934
|
-
// push. Mirror the hint that `push agent` already prints.
|
|
935
|
-
if (personaPushResult && !options.autoDeploy) {
|
|
936
|
-
writeInfo(`💡 Persona v${personaPushResult.version} pushed but not active on the dashboard yet.`);
|
|
937
|
-
writeInfo(' Run `lua deploy` or re-push with `--auto-deploy` to activate it.');
|
|
938
|
-
}
|
|
939
|
-
// Step 7: Deploy all queued components
|
|
940
|
-
if (options.autoDeploy && toDeploy.length > 0) {
|
|
941
|
-
writeProgress('\n🚀 Deploying all pushed versions to production...');
|
|
942
|
-
writeInfo('⏱️ Waiting for server to process versions (5 seconds)...\n');
|
|
943
|
-
await new Promise((resolve) => setTimeout(resolve, 5000));
|
|
944
|
-
for (const item of toDeploy) {
|
|
945
|
-
const deployed = await retryDeploy(async () => {
|
|
946
|
-
const result = await item.handler.publishVersion(apiKey, agentId, item.entityId, item.version);
|
|
947
|
-
if (!result.success)
|
|
948
|
-
throw new Error(result.error || 'Deploy failed');
|
|
949
|
-
}, item.name, item.version, 3);
|
|
950
|
-
if (deployed) {
|
|
951
|
-
writeSuccess(` 🚀 ${item.name} v${item.version} deployed`);
|
|
952
|
-
}
|
|
953
|
-
else {
|
|
954
|
-
console.warn(` ⚠️ ${item.name} deployment failed`);
|
|
955
|
-
deployFailedCount++;
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
}
|
|
959
|
-
// Deploy persona if pushed and autoDeploy is on
|
|
960
|
-
if (personaPushResult && options.autoDeploy) {
|
|
961
|
-
const deployed = await retryDeploy(async () => {
|
|
962
|
-
const personaApi = new PersonaApi(BASE_URLS.API, apiKey, agentId);
|
|
963
|
-
const deployResult = await personaApi.deployVersion(personaPushResult.version);
|
|
964
|
-
if (!deployResult.success)
|
|
965
|
-
throw new Error(deployResult.error?.message || 'Deploy failed');
|
|
966
|
-
}, 'persona', String(personaPushResult.version), 3);
|
|
967
|
-
if (deployed) {
|
|
968
|
-
writeSuccess(` 🚀 Persona v${personaPushResult.version} deployed`);
|
|
969
|
-
}
|
|
970
|
-
else {
|
|
971
|
-
console.warn(` ⚠️ Persona deployment failed`);
|
|
972
|
-
deployFailedCount++;
|
|
973
|
-
}
|
|
974
|
-
}
|
|
975
|
-
// Step 7.5: Push source backup (Phase 2 task 2.5: auto-backup hook).
|
|
976
|
-
// No try/catch by design — if the auto-backup-push fails, the whole
|
|
977
|
-
// `lua push all` should exit non-zero. Phase 2's deploy-invariant is
|
|
978
|
-
// that a primitive push never silently leaves the server's source
|
|
979
|
-
// backup out-of-date. Use runBackupPush (not pushBackupCommand) for
|
|
980
|
-
// the same reasons as the per-primitive hook above.
|
|
981
|
-
writeProgress('\n💾 Pushing source backup...');
|
|
982
|
-
{
|
|
983
|
-
const hookApiKey = requireAuthOrExit(false);
|
|
984
|
-
const hookConfig = readYamlConfig();
|
|
985
|
-
const hookAgentId = hookConfig?.agent?.agentId;
|
|
986
|
-
if (!hookAgentId) {
|
|
987
|
-
throw new Error('Cannot run auto-backup: no agentId in lua.skill.yaml.');
|
|
988
|
-
}
|
|
989
|
-
try {
|
|
990
|
-
const hookResult = await runBackupPush({
|
|
991
|
-
apiKey: hookApiKey,
|
|
992
|
-
agentId: hookAgentId,
|
|
993
|
-
force: true,
|
|
994
|
-
fresh: true,
|
|
995
|
-
triggeredBy: 'batch push',
|
|
996
|
-
});
|
|
997
|
-
writeInfo(`💾 Backup at v${hookResult.activeVersion} (${hookResult.filesUploaded} new file(s))`);
|
|
998
|
-
backupSuccess = true;
|
|
999
|
-
}
|
|
1000
|
-
catch (err) {
|
|
1001
|
-
const reason = err instanceof Error ? err.message : String(err);
|
|
1002
|
-
writeError(`Source backup failed after batch push: ${reason}\n\n` +
|
|
1003
|
-
`All primitives in this batch ARE deployed and live on the server — do NOT re-push.\n` +
|
|
1004
|
-
`The source backup just didn't sync. Recover with:\n\n` +
|
|
1005
|
-
` lua push backup --force --fresh\n\n` +
|
|
1006
|
-
`Until the backup catches up, \`lua init\` for this agent will restore an older snapshot.`);
|
|
1007
|
-
throw err;
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
// Step 8: Print summary
|
|
1011
|
-
writeSuccess('\n✅ Push All Complete!\n');
|
|
1012
|
-
// Group results by kind for display
|
|
1013
|
-
const byKind = new Map();
|
|
1014
|
-
for (const r of allResults) {
|
|
1015
|
-
const kind = r.handler.displayNamePlural;
|
|
1016
|
-
if (!byKind.has(kind))
|
|
1017
|
-
byKind.set(kind, []);
|
|
1018
|
-
byKind.get(kind).push(r);
|
|
1019
|
-
}
|
|
1020
|
-
const summaryIcons = {
|
|
1021
|
-
skills: '🛠️ ',
|
|
1022
|
-
webhooks: '🪝',
|
|
1023
|
-
jobs: '⏰',
|
|
1024
|
-
preprocessors: '📥',
|
|
1025
|
-
postprocessors: '📤',
|
|
1026
|
-
};
|
|
1027
|
-
for (const [kind, items] of byKind) {
|
|
1028
|
-
const icon = summaryIcons[kind] || '📦';
|
|
1029
|
-
console.log(`${icon} ${kind.charAt(0).toUpperCase() + kind.slice(1)} (${items.length}):`);
|
|
1030
|
-
items.forEach((i) => console.log(` • ${i.name} v${i.version}`));
|
|
1031
|
-
}
|
|
1032
|
-
if (personaPushResult) {
|
|
1033
|
-
console.log(`🌙 Persona:`);
|
|
1034
|
-
console.log(` • Version ${personaPushResult.version} created`);
|
|
1035
|
-
}
|
|
1036
|
-
if (backupSuccess) {
|
|
1037
|
-
console.log(`💾 Backup:`);
|
|
1038
|
-
console.log(` • Source files pushed`);
|
|
1039
|
-
}
|
|
1040
|
-
if (options.autoDeploy) {
|
|
1041
|
-
writeSuccess('\n🚀 All components deployed to production!');
|
|
1042
|
-
}
|
|
1043
|
-
const kindCounts = {};
|
|
1044
|
-
for (const [kind, items] of byKind) {
|
|
1045
|
-
kindCounts[kind] = items.length;
|
|
1046
|
-
}
|
|
1047
|
-
trackEvent('cli_push_completed', {
|
|
1048
|
-
primitive_type: 'all',
|
|
1049
|
-
force_mode: true,
|
|
1050
|
-
auto_deploy: options.autoDeploy || false,
|
|
1051
|
-
primitives_pushed_count: allResults.length,
|
|
1052
|
-
primitives_by_kind: kindCounts,
|
|
1053
|
-
mcp_servers_pushed: mcpPushedCount,
|
|
1054
|
-
persona_pushed: !!personaPushResult,
|
|
1055
|
-
backup_pushed: backupSuccess,
|
|
1056
|
-
// BAC-196 presigned-upload telemetry, summed across every primitive
|
|
1057
|
-
// pushed in this run. `bundles_existed` measures delta-upload hit rate.
|
|
1058
|
-
bundles_total: bundleStatsAggregate.total,
|
|
1059
|
-
bundles_uploaded: bundleStatsAggregate.uploaded,
|
|
1060
|
-
bundles_existed: bundleStatsAggregate.existed,
|
|
1061
|
-
});
|
|
1062
|
-
// B2: use actual successful MCP pushes, not attempt count, to determine pushedSomething.
|
|
1063
|
-
const pushedSomething = allResults.length > 0 || mcpPushedCount > 0 || !!personaPushResult || backupSuccess;
|
|
1064
|
-
// Pick the right hint variant based on the run outcome. We deliberately
|
|
1065
|
-
// ungate the tip from `pushedSomething` for the all-failed case so a
|
|
1066
|
-
// 100%-failed `lua push all --force` still surfaces a `lua logs` nudge
|
|
1067
|
-
// (previously it was silent, leaving users to guess what to do next).
|
|
1068
|
-
const variant = pickPushAllNextStepVariant({
|
|
1069
|
-
pushedSomething,
|
|
1070
|
-
failedCount: failedItems.length + deployFailedCount,
|
|
1071
|
-
});
|
|
1072
|
-
if (variant === 'success') {
|
|
1073
|
-
console.log('');
|
|
1074
|
-
if (options.autoDeploy) {
|
|
1075
|
-
writeHintBlock({
|
|
1076
|
-
headline: 'All deployed. Generate test traffic first, then inspect:',
|
|
1077
|
-
lines: [
|
|
1078
|
-
{ label: 'Test:', command: 'lua chat -e production -m "your test message"' },
|
|
1079
|
-
{ label: 'Inspect:', command: buildLogsCommand({ limit: 10 }) },
|
|
1080
|
-
],
|
|
1081
|
-
when: 'success',
|
|
1082
|
-
});
|
|
1083
|
-
}
|
|
1084
|
-
else {
|
|
1085
|
-
writeHintBlock({
|
|
1086
|
-
headline: 'Code staged but NOT live. Make it active:',
|
|
1087
|
-
lines: [
|
|
1088
|
-
{ label: 'Deploy all:', command: 'lua deploy all --force' },
|
|
1089
|
-
{ label: 'Or re-push:', command: 'lua push all --force --auto-deploy' },
|
|
1090
|
-
],
|
|
1091
|
-
when: 'success',
|
|
1092
|
-
});
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
else if (variant === 'partial') {
|
|
1096
|
-
console.log('');
|
|
1097
|
-
// Some components pushed, some failed. Suggest re-pushing the failures.
|
|
1098
|
-
// No lua logs hint: failed pushes produce no execution logs.
|
|
1099
|
-
writeNextStep({
|
|
1100
|
-
command: 'lua push all --force',
|
|
1101
|
-
rationale: 'to re-attempt the failed components',
|
|
1102
|
-
when: 'partial',
|
|
1103
|
-
});
|
|
1104
|
-
}
|
|
1105
|
-
else if (variant === 'error') {
|
|
1106
|
-
console.log('');
|
|
1107
|
-
// Total failure — nothing pushed, no execution logs exist.
|
|
1108
|
-
// No hint: the errors are already shown above.
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
/**
|
|
1112
|
-
* Retry deployment with exponential backoff
|
|
1113
|
-
* The server needs time to process pushed versions before they can be deployed
|
|
1114
|
-
*/
|
|
1115
|
-
async function retryDeploy(deployFn, _componentName, _version, maxRetries = 3) {
|
|
1116
|
-
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
1117
|
-
try {
|
|
1118
|
-
// Only delay on retry attempts (not first attempt)
|
|
1119
|
-
if (attempt > 1) {
|
|
1120
|
-
const delay = attempt * 2000; // 2s on 2nd attempt, 4s on 3rd, etc.
|
|
1121
|
-
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
1122
|
-
}
|
|
1123
|
-
await deployFn();
|
|
1124
|
-
// Show success message if succeeded after retrying
|
|
1125
|
-
if (attempt > 1) {
|
|
1126
|
-
writeInfo(` ✓ Succeeded on retry ${attempt}/${maxRetries}`);
|
|
1127
|
-
}
|
|
1128
|
-
return true;
|
|
1129
|
-
}
|
|
1130
|
-
catch (error) {
|
|
1131
|
-
// Extract detailed error message from API response
|
|
1132
|
-
const errorMessage = error?.error?.message || error?.message || 'Unknown error';
|
|
1133
|
-
if (attempt < maxRetries) {
|
|
1134
|
-
// Intermediate retry - show brief info
|
|
1135
|
-
writeInfo(` [Attempt ${attempt}/${maxRetries}] ${errorMessage} - retrying...`);
|
|
1136
|
-
}
|
|
1137
|
-
else {
|
|
1138
|
-
// Final attempt failed - show error
|
|
1139
|
-
console.error(` ❌ [Attempt ${attempt}/${maxRetries}] Deploy failed: ${errorMessage}`);
|
|
1140
|
-
}
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
return false;
|
|
1144
|
-
}
|
|
1145
|
-
//# sourceMappingURL=push.js.map
|