lua-cli 3.15.3 → 3.16.2
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 +41667 -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 +2 -2
- package/package.json +38 -21
- 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 -94
- package/dist/api/skills.api.service.d.ts.map +0 -1
- package/dist/api/skills.api.service.js +0 -120
- 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 -943
- 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 -493
- 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 -31
- package/dist/commands/push.d.ts.map +0 -1
- package/dist/commands/push.js +0 -1262
- 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 -22
- package/dist/compiler/utils/common.d.ts.map +0 -1
- package/dist/compiler/utils/common.js +0 -55
- 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 -17
- package/dist/interfaces/backup.d.ts.map +0 -1
- package/dist/interfaces/backup.js +0 -7
- 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 -238
- package/dist/utils/backup-helpers.d.ts.map +0 -1
- package/dist/utils/backup-helpers.js +0 -704
- package/dist/utils/backup-helpers.js.map +0 -1
- package/dist/utils/build-manifest-from-disk.d.ts +0 -8
- package/dist/utils/build-manifest-from-disk.d.ts.map +0 -1
- package/dist/utils/build-manifest-from-disk.js +0 -21
- 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-source-sync/dist/index.d.mts +0 -424
- package/node_modules/@lua/shared-source-sync/dist/index.d.ts +0 -424
- package/node_modules/@lua/shared-source-sync/dist/index.js +0 -536
- package/node_modules/@lua/shared-source-sync/dist/index.mjs +0 -491
- package/node_modules/@lua/shared-source-sync/package.json +0 -26
- package/node_modules/@lua/shared-source-sync/src/archive.ts +0 -98
- package/node_modules/@lua/shared-source-sync/src/filter.ts +0 -72
- package/node_modules/@lua/shared-source-sync/src/hash.ts +0 -40
- package/node_modules/@lua/shared-source-sync/src/http.ts +0 -132
- package/node_modules/@lua/shared-source-sync/src/index.ts +0 -56
- package/node_modules/@lua/shared-source-sync/src/pull.ts +0 -50
- package/node_modules/@lua/shared-source-sync/src/push.ts +0 -94
- package/node_modules/@lua/shared-source-sync/src/restore.ts +0 -83
- package/node_modules/@lua/shared-source-sync/src/skill-source.ts +0 -55
- package/node_modules/@lua/shared-source-sync/src/transfer.ts +0 -92
- package/node_modules/@lua/shared-source-sync/src/types.ts +0 -88
- package/node_modules/@lua/shared-source-sync/src/walk.ts +0 -91
- package/node_modules/@lua/shared-source-sync/tests/archive.test.ts +0 -108
- package/node_modules/@lua/shared-source-sync/tests/hash.test.ts +0 -40
- package/node_modules/@lua/shared-source-sync/tests/http.test.ts +0 -77
- package/node_modules/@lua/shared-source-sync/tests/push.test.ts +0 -162
- package/node_modules/@lua/shared-source-sync/tests/walk.test.ts +0 -84
- package/node_modules/@lua/shared-source-sync/tsconfig.json +0 -12
- package/node_modules/@lua/shared-source-sync/tsup.config.ts +0 -9
- package/node_modules/@lua/shared-source-sync/vitest.config.ts +0 -8
- package/node_modules/@lua/shared-types/dist/index.d.mts +0 -619
- package/node_modules/@lua/shared-types/dist/index.d.ts +0 -619
- 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 -18
- 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 -26
- 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
|
@@ -1,706 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Main Lua Compiler
|
|
3
|
-
*
|
|
4
|
-
* This is the entry point for compilation. It orchestrates:
|
|
5
|
-
* 1. Scanning source files for primitives
|
|
6
|
-
* 2. Validating all primitives
|
|
7
|
-
* 3. Bundling each primitive with esbuild
|
|
8
|
-
* 4. Writing artifacts to disk
|
|
9
|
-
*/
|
|
10
|
-
import fs from 'fs/promises';
|
|
11
|
-
import path from 'path';
|
|
12
|
-
import { Project } from 'ts-morph';
|
|
13
|
-
import { pluginRegistry } from './plugins/registry.js';
|
|
14
|
-
import { Bundler } from './bundler.js';
|
|
15
|
-
import { AgentTraverser } from './agent-traverser.js';
|
|
16
|
-
import { shouldSkipFile, shouldSkipDirectory, hashContent, formatSize, isInside, classifyProjectFile, } from './utils/common.js';
|
|
17
|
-
import { findWorkspaceRoot } from './utils/workspace.js';
|
|
18
|
-
import { registerProjectRootDir } from './utils/path-resolver.js';
|
|
19
|
-
import { ensureSchemaConverterReady, SchemaConverterUnavailableError } from './utils/schema-converter.js';
|
|
20
|
-
import { COMPILER_VERSION, } from './types.js';
|
|
21
|
-
// Re-export types for consumers
|
|
22
|
-
export * from './types.js';
|
|
23
|
-
// =============================================================================
|
|
24
|
-
// COMPILER
|
|
25
|
-
// =============================================================================
|
|
26
|
-
export class Compiler {
|
|
27
|
-
constructor(options) {
|
|
28
|
-
/**
|
|
29
|
-
* Absolute paths of source files loaded by `AgentTraverser` that live
|
|
30
|
-
* outside `rootDir` but inside the containing workspace.
|
|
31
|
-
*
|
|
32
|
-
* Populated during `scanForPrimitives()` and consumed by
|
|
33
|
-
* `collectProjectFiles()` so cross-root files are included in the
|
|
34
|
-
* backup manifest. See BAC-69 and [workspace.ts](src/compiler/utils/workspace.ts).
|
|
35
|
-
*/
|
|
36
|
-
this.externalWorkspaceFiles = [];
|
|
37
|
-
this.options = {
|
|
38
|
-
sourceMaps: true,
|
|
39
|
-
minify: true,
|
|
40
|
-
debug: false,
|
|
41
|
-
verbose: false,
|
|
42
|
-
quietWarnings: false,
|
|
43
|
-
runtimeValidation: true,
|
|
44
|
-
...options,
|
|
45
|
-
};
|
|
46
|
-
this.project = new Project({
|
|
47
|
-
tsConfigFilePath: path.join(options.rootDir, 'tsconfig.json'),
|
|
48
|
-
});
|
|
49
|
-
// Associate this Project with its rootDir so plugin code that only
|
|
50
|
-
// has a SourceFile/Project in hand (SkillPlugin's extractToolRefs,
|
|
51
|
-
// the reference resolver's tsconfig-paths lookup) can recover the
|
|
52
|
-
// correct rootDir without us threading it through every API.
|
|
53
|
-
registerProjectRootDir(this.project, this.options.rootDir);
|
|
54
|
-
this.bundler = new Bundler({
|
|
55
|
-
outDir: this.options.outDir,
|
|
56
|
-
minify: this.options.minify,
|
|
57
|
-
sourceMaps: this.options.sourceMaps,
|
|
58
|
-
debug: this.options.debug,
|
|
59
|
-
}, this.project, (msg) => this.verbose(msg));
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Run the compilation.
|
|
63
|
-
*/
|
|
64
|
-
async compile() {
|
|
65
|
-
const startTime = Date.now();
|
|
66
|
-
const errors = [];
|
|
67
|
-
const warnings = [];
|
|
68
|
-
const compiledPrimitives = [];
|
|
69
|
-
try {
|
|
70
|
-
// Preflight: load the bundled zod runtime once so a broken lua-cli
|
|
71
|
-
// installation fails loudly here, before we iterate primitives and
|
|
72
|
-
// silently ship a manifest with empty `inputSchema`s. Without this
|
|
73
|
-
// check, every per-primitive schema conversion would throw and the
|
|
74
|
-
// plugin's catch would degrade each tool to no schema, producing a
|
|
75
|
-
// "successful" build of an unusable agent.
|
|
76
|
-
try {
|
|
77
|
-
await ensureSchemaConverterReady();
|
|
78
|
-
}
|
|
79
|
-
catch (err) {
|
|
80
|
-
if (err instanceof SchemaConverterUnavailableError) {
|
|
81
|
-
errors.push({
|
|
82
|
-
file: 'lua-cli',
|
|
83
|
-
message: err.message,
|
|
84
|
-
suggestion: err.suggestion,
|
|
85
|
-
});
|
|
86
|
-
return await this.createResult(false, [], errors, warnings, startTime);
|
|
87
|
-
}
|
|
88
|
-
throw err;
|
|
89
|
-
}
|
|
90
|
-
// Step 1: Scan for primitives
|
|
91
|
-
this.verbose('📁 Scanning source files...');
|
|
92
|
-
const allMetadata = await this.scanForPrimitives();
|
|
93
|
-
if (allMetadata.length === 0) {
|
|
94
|
-
warnings.push({
|
|
95
|
-
file: this.options.rootDir,
|
|
96
|
-
message: 'No primitives found. Make sure you export primitives using define functions.',
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
// Step 2: Validate
|
|
100
|
-
this.verbose('✅ Validating primitives...');
|
|
101
|
-
for (const metadata of allMetadata) {
|
|
102
|
-
const plugin = pluginRegistry.get(metadata.kind);
|
|
103
|
-
if (!plugin) {
|
|
104
|
-
errors.push({
|
|
105
|
-
primitive: metadata.name,
|
|
106
|
-
kind: metadata.kind,
|
|
107
|
-
file: metadata.sourcePath,
|
|
108
|
-
line: metadata.line,
|
|
109
|
-
message: `Unknown primitive kind: ${metadata.kind}`,
|
|
110
|
-
});
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
const result = plugin.validate(metadata);
|
|
114
|
-
errors.push(...result.errors.map((e) => ({
|
|
115
|
-
primitive: metadata.name,
|
|
116
|
-
kind: metadata.kind,
|
|
117
|
-
file: metadata.sourcePath,
|
|
118
|
-
line: e.line || metadata.line,
|
|
119
|
-
column: e.column,
|
|
120
|
-
message: e.message,
|
|
121
|
-
suggestion: e.suggestion,
|
|
122
|
-
})));
|
|
123
|
-
if (!this.options.quietWarnings) {
|
|
124
|
-
warnings.push(...result.warnings.map((w) => ({
|
|
125
|
-
primitive: metadata.name,
|
|
126
|
-
kind: metadata.kind,
|
|
127
|
-
file: metadata.sourcePath,
|
|
128
|
-
line: w.line || metadata.line,
|
|
129
|
-
message: w.message,
|
|
130
|
-
})));
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
// Stop if validation errors
|
|
134
|
-
if (errors.length > 0) {
|
|
135
|
-
return await this.createResult(false, [], errors, warnings, startTime);
|
|
136
|
-
}
|
|
137
|
-
// Step 3: Compile each primitive (parallel with concurrency limit)
|
|
138
|
-
this.verbose('📦 Bundling primitives...');
|
|
139
|
-
// Ensure output directory exists
|
|
140
|
-
await fs.mkdir(this.options.outDir, { recursive: true });
|
|
141
|
-
await fs.mkdir(path.join(this.options.outDir, '.temp'), { recursive: true });
|
|
142
|
-
// Compile in parallel with concurrency limit
|
|
143
|
-
const CONCURRENCY = 4;
|
|
144
|
-
const compileResults = await this.compileInParallel(allMetadata, CONCURRENCY);
|
|
145
|
-
for (const result of compileResults) {
|
|
146
|
-
if ('error' in result) {
|
|
147
|
-
errors.push({
|
|
148
|
-
primitive: result.metadata.name,
|
|
149
|
-
kind: result.metadata.kind,
|
|
150
|
-
file: result.metadata.sourcePath,
|
|
151
|
-
message: `Compilation failed: ${result.error.message}`,
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
else if (result.compiled) {
|
|
155
|
-
compiledPrimitives.push(result.compiled);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
// Step 4: Write artifacts
|
|
159
|
-
this.verbose('💾 Writing artifacts...');
|
|
160
|
-
await this.writeArtifacts(compiledPrimitives);
|
|
161
|
-
// Step 5: Clean up temp files (unless debug mode)
|
|
162
|
-
if (!this.options.debug) {
|
|
163
|
-
await fs.rm(path.join(this.options.outDir, '.temp'), { recursive: true, force: true });
|
|
164
|
-
}
|
|
165
|
-
return await this.createResult(true, compiledPrimitives, errors, warnings, startTime);
|
|
166
|
-
}
|
|
167
|
-
catch (error) {
|
|
168
|
-
errors.push({
|
|
169
|
-
file: 'compiler',
|
|
170
|
-
message: `Unexpected error: ${error.message}`,
|
|
171
|
-
});
|
|
172
|
-
return await this.createResult(false, [], errors, warnings, startTime);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Scan for primitives using agent traversal (preferred) or fallback to full scan.
|
|
177
|
-
*
|
|
178
|
-
* Agent traversal only compiles primitives that are actually registered with
|
|
179
|
-
* a LuaAgent, matching the old compiler's behavior.
|
|
180
|
-
*
|
|
181
|
-
* Also caches the agent info for manifest creation (avoids re-traversing).
|
|
182
|
-
*/
|
|
183
|
-
async scanForPrimitives() {
|
|
184
|
-
// Try agent traversal first
|
|
185
|
-
const traverser = new AgentTraverser(this.options.rootDir, this.options.debug);
|
|
186
|
-
const primitives = await traverser.traverse();
|
|
187
|
-
// Capture any cross-root files the resolver pulled in, scoped to the
|
|
188
|
-
// containing workspace. These are backed up alongside in-project files
|
|
189
|
-
// so `lua init --from-server` can rebuild monorepo agents end-to-end.
|
|
190
|
-
this.externalWorkspaceFiles = this.collectExternalWorkspaceFiles(traverser);
|
|
191
|
-
if (primitives && primitives.length > 0) {
|
|
192
|
-
this.verbose(`🤖 Agent detected with ${primitives.length} primitives`);
|
|
193
|
-
if (this.externalWorkspaceFiles.length > 0) {
|
|
194
|
-
this.verbose(` 🌳 Cross-root workspace files: ${this.externalWorkspaceFiles.length}`);
|
|
195
|
-
}
|
|
196
|
-
return primitives;
|
|
197
|
-
}
|
|
198
|
-
// Fallback: scan all files (for projects without LuaAgent)
|
|
199
|
-
this.verbose(`⚠️ No LuaAgent found, scanning all source files...`);
|
|
200
|
-
return this.scanAllFiles();
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Resolve the containing workspace root for this compilation, memoized
|
|
204
|
-
* for the lifetime of the Compiler instance. Returns the normalized
|
|
205
|
-
* absolute path; for standalone agents it's identical to `rootDir`.
|
|
206
|
-
*/
|
|
207
|
-
getWorkspaceRoot() {
|
|
208
|
-
if (this._workspaceRoot === undefined) {
|
|
209
|
-
this._workspaceRoot = findWorkspaceRoot(path.resolve(this.options.rootDir));
|
|
210
|
-
}
|
|
211
|
-
return this._workspaceRoot;
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Return absolute paths of files the traverser loaded that live outside
|
|
215
|
-
* `rootDir` but inside the containing workspace.
|
|
216
|
-
*
|
|
217
|
-
* We deliberately skip:
|
|
218
|
-
* - Files under `rootDir` (the normal `collectProjectFiles` walker handles them)
|
|
219
|
-
* - Files inside `node_modules` (third-party; restored via `npm install`)
|
|
220
|
-
* - Files outside the detected workspace root (not our code)
|
|
221
|
-
*/
|
|
222
|
-
collectExternalWorkspaceFiles(traverser) {
|
|
223
|
-
const rootDir = path.resolve(this.options.rootDir);
|
|
224
|
-
const workspaceRoot = this.getWorkspaceRoot();
|
|
225
|
-
// Standalone agent: no workspace boundary, nothing to capture.
|
|
226
|
-
if (workspaceRoot === rootDir)
|
|
227
|
-
return [];
|
|
228
|
-
const loaded = traverser.getAllLoadedSourceFilePaths();
|
|
229
|
-
const result = [];
|
|
230
|
-
const seen = new Set();
|
|
231
|
-
for (const raw of loaded) {
|
|
232
|
-
const abs = path.resolve(raw);
|
|
233
|
-
if (seen.has(abs))
|
|
234
|
-
continue;
|
|
235
|
-
seen.add(abs);
|
|
236
|
-
if (isInside(abs, rootDir))
|
|
237
|
-
continue;
|
|
238
|
-
if (abs.includes(`${path.sep}node_modules${path.sep}`))
|
|
239
|
-
continue;
|
|
240
|
-
if (!isInside(abs, workspaceRoot))
|
|
241
|
-
continue;
|
|
242
|
-
result.push(abs);
|
|
243
|
-
}
|
|
244
|
-
return result;
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Fallback discovery: scan all source files for primitives when no LuaAgent is found.
|
|
248
|
-
*
|
|
249
|
-
* Unlike agent traversal (which only compiles registered primitives), this method
|
|
250
|
-
* runs every plugin on every source file to discover ALL primitive-like code:
|
|
251
|
-
* - ToolPlugin: defineTool() OR classes extending/implementing LuaTool
|
|
252
|
-
* - JobPlugin: defineJob() OR new LuaJob({...})
|
|
253
|
-
* - WebhookPlugin: defineWebhook() OR new LuaWebhook({...})
|
|
254
|
-
* - PreProcessorPlugin: definePreProcessor() OR new PreProcessor({...})
|
|
255
|
-
* - PostProcessorPlugin: definePostProcessor() OR new PostProcessor({...})
|
|
256
|
-
* - McpServerPlugin: defineMCPServer() OR new LuaMCPServer({...})
|
|
257
|
-
*
|
|
258
|
-
* This is less precise and may include unused primitives, but necessary for
|
|
259
|
-
* projects that don't use the LuaAgent pattern.
|
|
260
|
-
*
|
|
261
|
-
* @returns All detected primitive metadata from the entire codebase
|
|
262
|
-
*/
|
|
263
|
-
scanAllFiles() {
|
|
264
|
-
const allMetadata = [];
|
|
265
|
-
const sourceFiles = this.project.getSourceFiles();
|
|
266
|
-
for (const sourceFile of sourceFiles) {
|
|
267
|
-
const filePath = sourceFile.getFilePath();
|
|
268
|
-
// Skip files we don't want to scan
|
|
269
|
-
if (shouldSkipFile(filePath))
|
|
270
|
-
continue;
|
|
271
|
-
// Run all plugins on this file
|
|
272
|
-
for (const plugin of pluginRegistry.getAll()) {
|
|
273
|
-
try {
|
|
274
|
-
const metadata = plugin.detect(sourceFile);
|
|
275
|
-
allMetadata.push(...metadata);
|
|
276
|
-
}
|
|
277
|
-
catch (error) {
|
|
278
|
-
if (this.options.debug) {
|
|
279
|
-
console.warn(`Warning: Plugin ${plugin.kind} failed on ${filePath}:`, error);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
return allMetadata;
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Compile primitives in parallel with a concurrency limit.
|
|
288
|
-
* Returns results in the same order as input, with either compiled primitive or error.
|
|
289
|
-
*/
|
|
290
|
-
async compileInParallel(allMetadata, concurrency) {
|
|
291
|
-
const results = [];
|
|
292
|
-
// Process in batches of `concurrency`
|
|
293
|
-
for (let i = 0; i < allMetadata.length; i += concurrency) {
|
|
294
|
-
const batch = allMetadata.slice(i, i + concurrency);
|
|
295
|
-
const batchResults = await Promise.all(batch.map(async (metadata) => {
|
|
296
|
-
const plugin = pluginRegistry.get(metadata.kind);
|
|
297
|
-
if (plugin) {
|
|
298
|
-
this.verbose(` 📦 ${plugin.displayName}: ${metadata.name}`);
|
|
299
|
-
}
|
|
300
|
-
try {
|
|
301
|
-
const compiled = await this.compilePrimitive(metadata);
|
|
302
|
-
return { compiled, metadata };
|
|
303
|
-
}
|
|
304
|
-
catch (error) {
|
|
305
|
-
return { error, metadata };
|
|
306
|
-
}
|
|
307
|
-
}));
|
|
308
|
-
results.push(...batchResults);
|
|
309
|
-
}
|
|
310
|
-
return results;
|
|
311
|
-
}
|
|
312
|
-
/**
|
|
313
|
-
* Compile a single primitive through the full pipeline.
|
|
314
|
-
*
|
|
315
|
-
* The compilation pipeline for each primitive:
|
|
316
|
-
* 1. Generate entry point code via the plugin
|
|
317
|
-
* 2. Bundle with esbuild using stdin (no temp entry file) + virtual module plugin
|
|
318
|
-
* 3. Run plugin's post-processing hook (if any)
|
|
319
|
-
* 4. Extract schemas via plugin (e.g., Zod → JSON Schema for tools)
|
|
320
|
-
*
|
|
321
|
-
* Uses esbuild's stdin option for the entry point and a virtual module plugin
|
|
322
|
-
* that appends `export { X as __lua_target__ }` to the source file. This
|
|
323
|
-
* eliminates all temp files while handling non-exported primitives correctly.
|
|
324
|
-
*
|
|
325
|
-
* @param metadata - Primitive metadata from detection phase
|
|
326
|
-
* @returns Compiled primitive with bundled code, schemas, and metadata, or null if plugin not found
|
|
327
|
-
*/
|
|
328
|
-
async compilePrimitive(metadata) {
|
|
329
|
-
const plugin = pluginRegistry.get(metadata.kind);
|
|
330
|
-
if (!plugin)
|
|
331
|
-
return null;
|
|
332
|
-
// Metadata-only primitives (e.g. skills) can bypass esbuild entirely.
|
|
333
|
-
// A plugin may also return undefined to fall through to the default path
|
|
334
|
-
// (e.g. an agent with a model resolver still needs bundling).
|
|
335
|
-
if (plugin.buildArtifact) {
|
|
336
|
-
const directArtifact = await plugin.buildArtifact(metadata);
|
|
337
|
-
if (directArtifact) {
|
|
338
|
-
return {
|
|
339
|
-
...metadata,
|
|
340
|
-
artifact: directArtifact,
|
|
341
|
-
schemas: undefined,
|
|
342
|
-
};
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
// Generate entry point code (imports from source, creates wrapper)
|
|
346
|
-
const entryPointCode = plugin.generateEntryPoint(metadata);
|
|
347
|
-
// Bundle with esbuild using stdin + virtual source plugin (no temp files)
|
|
348
|
-
const artifact = await this.bundler.bundle(metadata, entryPointCode);
|
|
349
|
-
// Post-process if plugin supports it and runtime validation is enabled
|
|
350
|
-
const finalArtifact = plugin.postProcess && this.options.runtimeValidation ? plugin.postProcess(artifact, metadata) : artifact;
|
|
351
|
-
// Extract schemas if plugin supports it
|
|
352
|
-
const schemas = plugin.extractSchemas ? await plugin.extractSchemas(metadata, this.project) : undefined;
|
|
353
|
-
return {
|
|
354
|
-
...metadata,
|
|
355
|
-
artifact: finalArtifact,
|
|
356
|
-
schemas,
|
|
357
|
-
};
|
|
358
|
-
}
|
|
359
|
-
/**
|
|
360
|
-
* Write all compilation artifacts to disk with full project preservation.
|
|
361
|
-
*
|
|
362
|
-
* Output structure:
|
|
363
|
-
* ```
|
|
364
|
-
* dist-v2/
|
|
365
|
-
* ├── artifacts/
|
|
366
|
-
* │ ├── tool/
|
|
367
|
-
* │ │ ├── {name}.js # Bundled code
|
|
368
|
-
* │ │ ├── {name}.js.map # Source map
|
|
369
|
-
* │ │ └── {name}.json # Metadata (schemas, description, etc.)
|
|
370
|
-
* │ ├── job/
|
|
371
|
-
* │ ├── webhook/
|
|
372
|
-
* │ └── ...
|
|
373
|
-
* ├── sources/
|
|
374
|
-
* │ └── {hash}.ts # Deduplicated source files (by content hash)
|
|
375
|
-
* └── manifest.json # Full compilation manifest
|
|
376
|
-
* ```
|
|
377
|
-
*
|
|
378
|
-
* @param primitives - All compiled primitives to write
|
|
379
|
-
*/
|
|
380
|
-
async writeArtifacts(primitives) {
|
|
381
|
-
const artifactsDir = path.join(this.options.outDir, 'artifacts');
|
|
382
|
-
const sourcesDir = path.join(this.options.outDir, 'sources');
|
|
383
|
-
await fs.mkdir(sourcesDir, { recursive: true });
|
|
384
|
-
// Track written sources by hash to avoid duplicates
|
|
385
|
-
const writtenSources = new Map(); // hash -> relativePath
|
|
386
|
-
// Step 1: Write primitive artifacts (bundles, source maps, metadata)
|
|
387
|
-
await this.writePrimitiveArtifacts(primitives, artifactsDir, sourcesDir, writtenSources);
|
|
388
|
-
// Step 2: Collect and store all project files for full reconstruction
|
|
389
|
-
this.verbose(' 📂 Collecting project files...');
|
|
390
|
-
const projectFiles = await this.storeProjectFiles(sourcesDir, writtenSources);
|
|
391
|
-
// Step 3: Create and write manifest
|
|
392
|
-
const manifest = await this.createManifest(primitives, projectFiles);
|
|
393
|
-
await fs.writeFile(path.join(this.options.outDir, 'manifest.json'), JSON.stringify(manifest, null, 2));
|
|
394
|
-
this.verbose(` 📦 Total files stored: ${writtenSources.size} (deduplicated)`);
|
|
395
|
-
this.verbose(` 📁 Project files: ${projectFiles.length}`);
|
|
396
|
-
if (this.options.verbose || this.options.debug) {
|
|
397
|
-
this.logTree(primitives);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
/**
|
|
401
|
-
* Write primitive artifacts: bundles, source maps, and metadata JSON files.
|
|
402
|
-
*/
|
|
403
|
-
async writePrimitiveArtifacts(primitives, artifactsDir, sourcesDir, writtenSources) {
|
|
404
|
-
for (const primitive of primitives) {
|
|
405
|
-
const primitiveDir = path.join(artifactsDir, primitive.kind);
|
|
406
|
-
await fs.mkdir(primitiveDir, { recursive: true });
|
|
407
|
-
const baseName = primitive.name;
|
|
408
|
-
// Write bundle
|
|
409
|
-
await fs.writeFile(path.join(primitiveDir, `${baseName}.js`), primitive.artifact.code);
|
|
410
|
-
// Write source map
|
|
411
|
-
if (primitive.artifact.sourceMap) {
|
|
412
|
-
await fs.writeFile(path.join(primitiveDir, `${baseName}.js.map`), primitive.artifact.sourceMap);
|
|
413
|
-
}
|
|
414
|
-
// Deduplicate and store original source
|
|
415
|
-
const sourceHash = hashContent(primitive.artifact.originalSource);
|
|
416
|
-
if (!writtenSources.has(sourceHash)) {
|
|
417
|
-
const ext = primitive.sourcePath.endsWith('.tsx') ? '.tsx' : '.ts';
|
|
418
|
-
await fs.writeFile(path.join(sourcesDir, `${sourceHash}${ext}`), primitive.artifact.originalSource);
|
|
419
|
-
const relativePath = path.relative(this.options.rootDir, primitive.sourcePath);
|
|
420
|
-
writtenSources.set(sourceHash, relativePath);
|
|
421
|
-
}
|
|
422
|
-
// Write metadata JSON. Route `metadata` through the plugin's
|
|
423
|
-
// sanitizer so build-machine-only fields (e.g. skill's
|
|
424
|
-
// `toolRefSourcePaths` — absolute paths) never land on disk. The
|
|
425
|
-
// artifact hash already excludes those, so sanitizing the sidecar
|
|
426
|
-
// too makes the on-disk footprint fully reproducible.
|
|
427
|
-
const sidecarPlugin = pluginRegistry.get(primitive.kind);
|
|
428
|
-
const sidecarMetadata = sidecarPlugin?.sanitizeForPersistence
|
|
429
|
-
? sidecarPlugin.sanitizeForPersistence(primitive.metadata)
|
|
430
|
-
: primitive.metadata;
|
|
431
|
-
await fs.writeFile(path.join(primitiveDir, `${baseName}.json`), JSON.stringify({
|
|
432
|
-
kind: primitive.kind,
|
|
433
|
-
name: primitive.name,
|
|
434
|
-
description: primitive.description,
|
|
435
|
-
sourcePath: primitive.sourcePath,
|
|
436
|
-
sourceHash,
|
|
437
|
-
schemas: primitive.schemas,
|
|
438
|
-
metadata: sidecarMetadata,
|
|
439
|
-
size: primitive.artifact.size,
|
|
440
|
-
hash: primitive.artifact.hash,
|
|
441
|
-
}, null, 2));
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
/**
|
|
445
|
-
* Store all project files for full reconstruction (enables `lua init --from-server`).
|
|
446
|
-
* Returns the list of project files with their hashes.
|
|
447
|
-
*/
|
|
448
|
-
async storeProjectFiles(sourcesDir, writtenSources) {
|
|
449
|
-
const projectFiles = [];
|
|
450
|
-
const allFiles = await this.collectProjectFiles();
|
|
451
|
-
const workspaceRoot = this.getWorkspaceRoot();
|
|
452
|
-
for (const file of allFiles) {
|
|
453
|
-
// External files resolve against the workspace root; in-project files
|
|
454
|
-
// against `rootDir`. `file.external` decides which base to use.
|
|
455
|
-
const absPath = file.external
|
|
456
|
-
? path.join(workspaceRoot, file.relativePath)
|
|
457
|
-
: path.join(this.options.rootDir, file.relativePath);
|
|
458
|
-
const content = await fs.readFile(absPath, 'utf-8');
|
|
459
|
-
const hash = hashContent(content);
|
|
460
|
-
// Store if not already stored (deduplication)
|
|
461
|
-
if (!writtenSources.has(hash)) {
|
|
462
|
-
const ext = path.extname(file.relativePath) || '.txt';
|
|
463
|
-
await fs.writeFile(path.join(sourcesDir, `${hash}${ext}`), content);
|
|
464
|
-
writtenSources.set(hash, file.relativePath);
|
|
465
|
-
}
|
|
466
|
-
projectFiles.push({
|
|
467
|
-
relativePath: file.relativePath,
|
|
468
|
-
hash,
|
|
469
|
-
size: content.length,
|
|
470
|
-
type: file.type,
|
|
471
|
-
...(file.external ? { external: true } : {}),
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
return projectFiles;
|
|
475
|
-
}
|
|
476
|
-
/**
|
|
477
|
-
* Create the compilation manifest with all metadata.
|
|
478
|
-
*
|
|
479
|
-
* Uses cached agent info from scanForPrimitives() to avoid re-traversing.
|
|
480
|
-
* Delegates to each plugin's toManifestEntry() for type-specific fields.
|
|
481
|
-
*/
|
|
482
|
-
async createManifest(primitives, projectFiles) {
|
|
483
|
-
// Extract config file hashes
|
|
484
|
-
const config = {};
|
|
485
|
-
const packageJsonFile = projectFiles.find((f) => f.relativePath === 'package.json');
|
|
486
|
-
if (packageJsonFile)
|
|
487
|
-
config.packageJson = packageJsonFile.hash;
|
|
488
|
-
const tsconfigFile = projectFiles.find((f) => f.relativePath === 'tsconfig.json');
|
|
489
|
-
if (tsconfigFile)
|
|
490
|
-
config.tsconfigJson = tsconfigFile.hash;
|
|
491
|
-
const yamlFile = projectFiles.find((f) => f.relativePath === 'lua.skill.yaml');
|
|
492
|
-
if (yamlFile)
|
|
493
|
-
config.luaSkillYaml = yamlFile.hash;
|
|
494
|
-
return {
|
|
495
|
-
version: COMPILER_VERSION,
|
|
496
|
-
compiledAt: new Date().toISOString(),
|
|
497
|
-
primitives: await this.mapPrimitivesToManifest(primitives),
|
|
498
|
-
projectFiles,
|
|
499
|
-
config,
|
|
500
|
-
};
|
|
501
|
-
}
|
|
502
|
-
/**
|
|
503
|
-
* Map compiled primitives to manifest entries using plugins.
|
|
504
|
-
* Single source of truth for primitive → manifest conversion.
|
|
505
|
-
*/
|
|
506
|
-
async mapPrimitivesToManifest(primitives) {
|
|
507
|
-
return Promise.all(primitives.map(async (p) => {
|
|
508
|
-
const plugin = pluginRegistry.get(p.kind);
|
|
509
|
-
if (plugin) {
|
|
510
|
-
return plugin.toManifestEntry(p, primitives);
|
|
511
|
-
}
|
|
512
|
-
// Fallback for unknown kinds (should not happen)
|
|
513
|
-
return {
|
|
514
|
-
kind: p.kind,
|
|
515
|
-
name: p.name,
|
|
516
|
-
description: p.description,
|
|
517
|
-
path: `artifacts/${p.kind}/${p.name}.js`,
|
|
518
|
-
sourcePath: p.sourcePath,
|
|
519
|
-
hash: p.artifact.hash,
|
|
520
|
-
};
|
|
521
|
-
}));
|
|
522
|
-
}
|
|
523
|
-
/**
|
|
524
|
-
* Recursively collect all project files for full reconstruction.
|
|
525
|
-
*
|
|
526
|
-
* This enables `lua init --from-server` to recreate the exact project structure.
|
|
527
|
-
*
|
|
528
|
-
* File categorization:
|
|
529
|
-
* - 'source': .ts, .tsx, .js files
|
|
530
|
-
* - 'config': package.json, tsconfig.json, lua.skill.yaml, *.yaml, *.yml, *.json
|
|
531
|
-
* - 'other': README.md, .env.example, etc.
|
|
532
|
-
*
|
|
533
|
-
* Excludes (via shouldSkipDirectory/shouldSkipFile):
|
|
534
|
-
* - node_modules, dist, .git, coverage, etc.
|
|
535
|
-
* - test files, declaration files, lock files
|
|
536
|
-
*
|
|
537
|
-
* @returns Array of file info with relative paths and categorized types
|
|
538
|
-
*/
|
|
539
|
-
async collectProjectFiles() {
|
|
540
|
-
const files = [];
|
|
541
|
-
const scanDir = async (dir, relativeBase = '') => {
|
|
542
|
-
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
543
|
-
for (const entry of entries) {
|
|
544
|
-
const relativePath = relativeBase ? `${relativeBase}/${entry.name}` : entry.name;
|
|
545
|
-
const fullPath = path.join(dir, entry.name);
|
|
546
|
-
// Skip directories we don't want
|
|
547
|
-
if (entry.isDirectory()) {
|
|
548
|
-
if (shouldSkipDirectory(entry.name))
|
|
549
|
-
continue;
|
|
550
|
-
await scanDir(fullPath, relativePath);
|
|
551
|
-
continue;
|
|
552
|
-
}
|
|
553
|
-
// Skip files we don't want
|
|
554
|
-
if (shouldSkipFile(entry.name))
|
|
555
|
-
continue;
|
|
556
|
-
files.push({ relativePath, type: classifyProjectFile(entry.name) });
|
|
557
|
-
}
|
|
558
|
-
};
|
|
559
|
-
await scanDir(this.options.rootDir);
|
|
560
|
-
// Append cross-root workspace files picked up by the traverser (BAC-69).
|
|
561
|
-
// These are keyed by their workspace-relative path and marked external so
|
|
562
|
-
// the restore step can sandbox them under `.lua/external/`.
|
|
563
|
-
//
|
|
564
|
-
// Important: dedup external files against each other, *not* against
|
|
565
|
-
// in-project files. In-project keys are rootDir-relative; external keys
|
|
566
|
-
// are workspace-relative, and the two namespaces can coincidentally
|
|
567
|
-
// collide (e.g. rootDir `/ws/packages/agent/src/index.ts` → `src/index.ts`
|
|
568
|
-
// and workspace-root `/ws/src/index.ts` → `src/index.ts`). A single
|
|
569
|
-
// shared `Set` would silently drop the external one — the exact class
|
|
570
|
-
// of silent-drop bug BAC-69 was meant to eliminate. The restore path
|
|
571
|
-
// uses `file.external` (not the string shape of `relativePath`) to
|
|
572
|
-
// decide where each entry lands, so co-existing entries with the same
|
|
573
|
-
// `relativePath` but different `external` flags is safe.
|
|
574
|
-
const workspaceRoot = this.getWorkspaceRoot();
|
|
575
|
-
const externalSeen = new Set();
|
|
576
|
-
for (const abs of this.externalWorkspaceFiles) {
|
|
577
|
-
const rel = path.relative(workspaceRoot, abs).split(path.sep).join('/');
|
|
578
|
-
if (!rel || rel.startsWith('..'))
|
|
579
|
-
continue;
|
|
580
|
-
if (externalSeen.has(rel))
|
|
581
|
-
continue;
|
|
582
|
-
const name = path.basename(abs);
|
|
583
|
-
// Defense-in-depth: `shouldSkipFile` accepts either a filename or
|
|
584
|
-
// a full path and checks both the leading-dot rule and path-based
|
|
585
|
-
// skips (node_modules, .test., .spec., .d.ts, lock files, etc.).
|
|
586
|
-
// We pass the *relative* path so nested paths that slipped past
|
|
587
|
-
// the basename-only check upstream are still caught here — any
|
|
588
|
-
// future refactor that changes how external paths are collected
|
|
589
|
-
// can't silently leak dotfiles or lock files into the manifest.
|
|
590
|
-
if (shouldSkipFile(rel) || shouldSkipFile(name))
|
|
591
|
-
continue;
|
|
592
|
-
externalSeen.add(rel);
|
|
593
|
-
files.push({ relativePath: rel, type: classifyProjectFile(name), external: true });
|
|
594
|
-
}
|
|
595
|
-
return files;
|
|
596
|
-
}
|
|
597
|
-
/**
|
|
598
|
-
* Log the output directory tree.
|
|
599
|
-
*/
|
|
600
|
-
logTree(primitives) {
|
|
601
|
-
this.log(` ${this.options.outDir}/`);
|
|
602
|
-
this.log(` ├── artifacts/`);
|
|
603
|
-
const byKind = new Map();
|
|
604
|
-
for (const p of primitives) {
|
|
605
|
-
const list = byKind.get(p.kind) || [];
|
|
606
|
-
list.push(p);
|
|
607
|
-
byKind.set(p.kind, list);
|
|
608
|
-
}
|
|
609
|
-
const kinds = Array.from(byKind.keys());
|
|
610
|
-
kinds.forEach((kind, i) => {
|
|
611
|
-
const isLast = i === kinds.length - 1;
|
|
612
|
-
const primitiveList = byKind.get(kind);
|
|
613
|
-
this.log(` │ ${isLast ? '└' : '├'}── ${kind}/`);
|
|
614
|
-
primitiveList.forEach((p, j) => {
|
|
615
|
-
const isLastPrimitive = j === primitiveList.length - 1;
|
|
616
|
-
const prefix = isLast ? ' ' : '│ ';
|
|
617
|
-
this.log(` ${prefix} ${isLastPrimitive ? '└' : '├'}── ${p.name}.js (${formatSize(p.artifact.size)})`);
|
|
618
|
-
});
|
|
619
|
-
});
|
|
620
|
-
this.log(` └── manifest.json`);
|
|
621
|
-
}
|
|
622
|
-
/**
|
|
623
|
-
* Create the compilation result with stats.
|
|
624
|
-
* Note: The full manifest (with projectFiles) is written by writeArtifacts.
|
|
625
|
-
* This returns a minimal manifest for the result object.
|
|
626
|
-
*/
|
|
627
|
-
async createResult(success, primitives, errors, warnings, startTime) {
|
|
628
|
-
const stats = this.calculateStats(primitives, startTime);
|
|
629
|
-
return {
|
|
630
|
-
success,
|
|
631
|
-
manifest: await this.createMinimalManifest(primitives),
|
|
632
|
-
errors,
|
|
633
|
-
warnings,
|
|
634
|
-
stats,
|
|
635
|
-
};
|
|
636
|
-
}
|
|
637
|
-
/**
|
|
638
|
-
* Calculate compilation statistics.
|
|
639
|
-
*/
|
|
640
|
-
calculateStats(primitives, startTime) {
|
|
641
|
-
const byKind = {};
|
|
642
|
-
let totalSize = 0;
|
|
643
|
-
for (const p of primitives) {
|
|
644
|
-
byKind[p.kind] = (byKind[p.kind] || 0) + 1;
|
|
645
|
-
totalSize += p.artifact.size;
|
|
646
|
-
}
|
|
647
|
-
return {
|
|
648
|
-
totalPrimitives: primitives.length,
|
|
649
|
-
byKind,
|
|
650
|
-
totalSize,
|
|
651
|
-
duration: Date.now() - startTime,
|
|
652
|
-
};
|
|
653
|
-
}
|
|
654
|
-
/**
|
|
655
|
-
* Create a minimal manifest for the result object.
|
|
656
|
-
* The full manifest (with projectFiles) is written to disk by writeArtifacts.
|
|
657
|
-
*/
|
|
658
|
-
async createMinimalManifest(primitives) {
|
|
659
|
-
return {
|
|
660
|
-
version: COMPILER_VERSION,
|
|
661
|
-
compiledAt: new Date().toISOString(),
|
|
662
|
-
primitives: await this.mapPrimitivesToManifest(primitives),
|
|
663
|
-
projectFiles: [],
|
|
664
|
-
config: {},
|
|
665
|
-
};
|
|
666
|
-
}
|
|
667
|
-
/**
|
|
668
|
-
* Log a message (always shown).
|
|
669
|
-
*/
|
|
670
|
-
log(message) {
|
|
671
|
-
console.log(message);
|
|
672
|
-
}
|
|
673
|
-
/**
|
|
674
|
-
* Log a verbose message (only shown in verbose or debug mode).
|
|
675
|
-
*/
|
|
676
|
-
verbose(message) {
|
|
677
|
-
if (this.options.verbose || this.options.debug) {
|
|
678
|
-
console.log(message);
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
// =============================================================================
|
|
683
|
-
// CONVENIENCE FUNCTION
|
|
684
|
-
// =============================================================================
|
|
685
|
-
/**
|
|
686
|
-
* Compile a Lua project.
|
|
687
|
-
*
|
|
688
|
-
* @example
|
|
689
|
-
* ```typescript
|
|
690
|
-
* const result = await compile({
|
|
691
|
-
* rootDir: process.cwd(),
|
|
692
|
-
* outDir: 'dist',
|
|
693
|
-
* });
|
|
694
|
-
*
|
|
695
|
-
* if (!result.success) {
|
|
696
|
-
* console.error('Compilation failed:');
|
|
697
|
-
* result.errors.forEach(e => console.error(` ${e.message}`));
|
|
698
|
-
* process.exit(1);
|
|
699
|
-
* }
|
|
700
|
-
* ```
|
|
701
|
-
*/
|
|
702
|
-
export async function compile(options) {
|
|
703
|
-
const compiler = new Compiler(options);
|
|
704
|
-
return compiler.compile();
|
|
705
|
-
}
|
|
706
|
-
//# sourceMappingURL=compiler.js.map
|