lua-cli 3.15.3 → 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 -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
package/dist/utils/sandbox.js
DELETED
|
@@ -1,664 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'module';
|
|
2
|
-
import vm from 'vm';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import { parseEnvFile } from './env-loader.utils.js';
|
|
5
|
-
import UserDataApiService from '../api/user.data.api.service.js';
|
|
6
|
-
import { BASE_URLS } from '../config/constants.js';
|
|
7
|
-
import ProductApiService from '../api/products.api.service.js';
|
|
8
|
-
import BasketApiService from '../api/basket.api.service.js';
|
|
9
|
-
import OrderApiService from '../api/order.api.service.js';
|
|
10
|
-
import CustomDataApiService from '../api/custom.data.api.service.js';
|
|
11
|
-
import WebhookApi from '../api/webhook.api.service.js';
|
|
12
|
-
import JobApi from '../api/job.api.service.js';
|
|
13
|
-
import WhatsAppTemplatesApiService from '../api/whatsapp-templates.api.service.js';
|
|
14
|
-
import CdnApiService from '../api/cdn.api.service.js';
|
|
15
|
-
import { BasketStatus } from '../interfaces/baskets.js';
|
|
16
|
-
import { OrderStatus } from '../interfaces/orders.js';
|
|
17
|
-
import { compressForPush } from './artifact-loader.js';
|
|
18
|
-
import { PRIMITIVE_SHIMS } from '../config/compile.constants.js';
|
|
19
|
-
// Alias for backward compatibility in sandbox context
|
|
20
|
-
const compressCode = compressForPush;
|
|
21
|
-
/**
|
|
22
|
-
* Loads environment variables from multiple sources in priority order:
|
|
23
|
-
* 1. process.env (lowest priority)
|
|
24
|
-
* 2. .env file (overrides process.env)
|
|
25
|
-
*/
|
|
26
|
-
export function loadEnvironmentVariables() {
|
|
27
|
-
const envVars = {};
|
|
28
|
-
// 1. Start with process.env
|
|
29
|
-
for (const [key, value] of Object.entries(process.env)) {
|
|
30
|
-
if (value !== undefined) {
|
|
31
|
-
envVars[key] = value;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
// 2. Load from .env file if it exists (using shared parser)
|
|
35
|
-
const envFilePath = path.join(process.cwd(), '.env');
|
|
36
|
-
const fileEnvVars = parseEnvFile(envFilePath);
|
|
37
|
-
// Merge .env file vars (override process.env)
|
|
38
|
-
Object.assign(envVars, fileEnvVars);
|
|
39
|
-
return envVars;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Creates a VM sandbox context with all necessary globals and utilities.
|
|
43
|
-
*
|
|
44
|
-
* Available globals in the sandbox:
|
|
45
|
-
* - User: User data API
|
|
46
|
-
* - Products: Product catalog API
|
|
47
|
-
* - Data: Custom data collections API
|
|
48
|
-
* - Baskets: Shopping basket API
|
|
49
|
-
* - Orders: Order management API
|
|
50
|
-
* - Templates: Template APIs (whatsapp)
|
|
51
|
-
* - CDN: File upload/retrieval API
|
|
52
|
-
* - Jobs: Job scheduling API
|
|
53
|
-
* - AI: AI generation API
|
|
54
|
-
* - env(): Environment variable access function
|
|
55
|
-
* - console, fetch, and other standard globals
|
|
56
|
-
*/
|
|
57
|
-
/**
|
|
58
|
-
* Injects polyfills into a VM context's global scope.
|
|
59
|
-
* This ensures libraries expecting browser APIs work correctly in the sandbox.
|
|
60
|
-
*/
|
|
61
|
-
function injectPolyfillsIntoContext(context) {
|
|
62
|
-
vm.runInContext(`
|
|
63
|
-
if (typeof global !== 'undefined') {
|
|
64
|
-
global.AbortController = AbortController;
|
|
65
|
-
global.FormData = FormData;
|
|
66
|
-
global.TextEncoder = TextEncoder;
|
|
67
|
-
global.TextDecoder = TextDecoder;
|
|
68
|
-
global.crypto = crypto;
|
|
69
|
-
global.fetch = fetch;
|
|
70
|
-
global.Headers = Headers;
|
|
71
|
-
global.Request = Request;
|
|
72
|
-
global.Response = Response;
|
|
73
|
-
global.URL = URL;
|
|
74
|
-
global.URLSearchParams = URLSearchParams;
|
|
75
|
-
global.File = File;
|
|
76
|
-
global.Blob = Blob;
|
|
77
|
-
}
|
|
78
|
-
`, context);
|
|
79
|
-
}
|
|
80
|
-
export function createSandbox(options) {
|
|
81
|
-
const { apiKey, agentId, customConsole, broadcastLog } = options;
|
|
82
|
-
// Load environment variables from multiple sources (same logic as test command)
|
|
83
|
-
const envVars = loadEnvironmentVariables();
|
|
84
|
-
// Create a CommonJS context for execution
|
|
85
|
-
const require = createRequire(process.cwd() + '/package.json');
|
|
86
|
-
// Create console object (use custom console if provided, otherwise default)
|
|
87
|
-
const consoleObj = customConsole || console;
|
|
88
|
-
// Create API service instances
|
|
89
|
-
const userService = new UserDataApiService(BASE_URLS.API, apiKey, agentId);
|
|
90
|
-
const productService = new ProductApiService(BASE_URLS.API, apiKey, agentId);
|
|
91
|
-
const dataService = new CustomDataApiService(BASE_URLS.API, apiKey, agentId);
|
|
92
|
-
const basketsService = new BasketApiService(BASE_URLS.API, apiKey, agentId);
|
|
93
|
-
const orderService = new OrderApiService(BASE_URLS.API, apiKey, agentId);
|
|
94
|
-
const webhookService = new WebhookApi(BASE_URLS.API, apiKey, agentId);
|
|
95
|
-
const jobService = new JobApi(BASE_URLS.API, apiKey, agentId);
|
|
96
|
-
const whatsAppTemplatesService = new WhatsAppTemplatesApiService(BASE_URLS.API, apiKey, agentId);
|
|
97
|
-
const cdnService = new CdnApiService(BASE_URLS.CDN, apiKey);
|
|
98
|
-
// Override User service methods if needed
|
|
99
|
-
// Example: Override the update method
|
|
100
|
-
// const originalUpdate = userService.update.bind(userService);
|
|
101
|
-
// userService.update = async (data: any) => {
|
|
102
|
-
// console.log('Custom update logic here');
|
|
103
|
-
// return await originalUpdate(data);
|
|
104
|
-
// };
|
|
105
|
-
// Create comprehensive polyfills for browser/Node.js APIs
|
|
106
|
-
const polyfills = {
|
|
107
|
-
// AbortController polyfill
|
|
108
|
-
AbortController: globalThis.AbortController ||
|
|
109
|
-
class AbortController {
|
|
110
|
-
constructor() {
|
|
111
|
-
this.signal = {
|
|
112
|
-
aborted: false,
|
|
113
|
-
addEventListener: () => { },
|
|
114
|
-
removeEventListener: () => { },
|
|
115
|
-
dispatchEvent: () => { },
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
abort() {
|
|
119
|
-
this.signal.aborted = true;
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
// FormData polyfill
|
|
123
|
-
FormData: globalThis.FormData ||
|
|
124
|
-
class FormData {
|
|
125
|
-
constructor() {
|
|
126
|
-
this._data = [];
|
|
127
|
-
}
|
|
128
|
-
append(name, value) {
|
|
129
|
-
this._data.push({ name, value });
|
|
130
|
-
}
|
|
131
|
-
get(name) {
|
|
132
|
-
const item = this._data.find((d) => d.name === name);
|
|
133
|
-
return item ? item.value : null;
|
|
134
|
-
}
|
|
135
|
-
getAll(name) {
|
|
136
|
-
return this._data.filter((d) => d.name === name).map((d) => d.value);
|
|
137
|
-
}
|
|
138
|
-
has(name) {
|
|
139
|
-
return this._data.some((d) => d.name === name);
|
|
140
|
-
}
|
|
141
|
-
delete(name) {
|
|
142
|
-
this._data = this._data.filter((d) => d.name !== name);
|
|
143
|
-
}
|
|
144
|
-
set(name, value) {
|
|
145
|
-
this.delete(name);
|
|
146
|
-
this.append(name, value);
|
|
147
|
-
}
|
|
148
|
-
entries() {
|
|
149
|
-
return this._data.map((d) => [d.name, d.value]);
|
|
150
|
-
}
|
|
151
|
-
keys() {
|
|
152
|
-
return this._data.map((d) => d.name);
|
|
153
|
-
}
|
|
154
|
-
values() {
|
|
155
|
-
return this._data.map((d) => d.value);
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
// TextEncoder/TextDecoder polyfills
|
|
159
|
-
TextEncoder: globalThis.TextEncoder ||
|
|
160
|
-
class TextEncoder {
|
|
161
|
-
encode(input) {
|
|
162
|
-
return Buffer.from(input, 'utf8');
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
TextDecoder: globalThis.TextDecoder ||
|
|
166
|
-
class TextDecoder {
|
|
167
|
-
decode(input) {
|
|
168
|
-
return Buffer.from(input).toString('utf8');
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
// Crypto polyfill (basic)
|
|
172
|
-
crypto: globalThis.crypto || {
|
|
173
|
-
randomUUID: () => {
|
|
174
|
-
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
175
|
-
const r = (Math.random() * 16) | 0;
|
|
176
|
-
const v = c === 'x' ? r : (r & 0x3) | 0x8;
|
|
177
|
-
return v.toString(16);
|
|
178
|
-
});
|
|
179
|
-
},
|
|
180
|
-
getRandomValues: (array) => {
|
|
181
|
-
for (let i = 0; i < array.length; i++) {
|
|
182
|
-
array[i] = Math.floor(Math.random() * 256);
|
|
183
|
-
}
|
|
184
|
-
return array;
|
|
185
|
-
},
|
|
186
|
-
},
|
|
187
|
-
};
|
|
188
|
-
// Create a sandbox context
|
|
189
|
-
const sandbox = {
|
|
190
|
-
require,
|
|
191
|
-
console: consoleObj,
|
|
192
|
-
Buffer,
|
|
193
|
-
setTimeout,
|
|
194
|
-
setInterval,
|
|
195
|
-
clearTimeout,
|
|
196
|
-
clearInterval,
|
|
197
|
-
global: globalThis,
|
|
198
|
-
__dirname: process.cwd(),
|
|
199
|
-
__filename: path.join(process.cwd(), 'index.ts'),
|
|
200
|
-
module: { exports: {} },
|
|
201
|
-
exports: {},
|
|
202
|
-
// Web APIs with polyfills
|
|
203
|
-
fetch: globalThis.fetch,
|
|
204
|
-
URLSearchParams: globalThis.URLSearchParams,
|
|
205
|
-
URL: globalThis.URL,
|
|
206
|
-
Headers: globalThis.Headers,
|
|
207
|
-
Request: globalThis.Request,
|
|
208
|
-
Response: globalThis.Response,
|
|
209
|
-
File: globalThis.File,
|
|
210
|
-
Blob: globalThis.Blob,
|
|
211
|
-
FormData: polyfills.FormData,
|
|
212
|
-
AbortController: polyfills.AbortController,
|
|
213
|
-
TextEncoder: polyfills.TextEncoder,
|
|
214
|
-
TextDecoder: polyfills.TextDecoder,
|
|
215
|
-
crypto: polyfills.crypto,
|
|
216
|
-
// Additional globals
|
|
217
|
-
Object,
|
|
218
|
-
Array,
|
|
219
|
-
String,
|
|
220
|
-
Number,
|
|
221
|
-
Boolean,
|
|
222
|
-
Date,
|
|
223
|
-
Math,
|
|
224
|
-
JSON,
|
|
225
|
-
Error,
|
|
226
|
-
TypeError,
|
|
227
|
-
ReferenceError,
|
|
228
|
-
SyntaxError,
|
|
229
|
-
globalThis,
|
|
230
|
-
undefined: undefined,
|
|
231
|
-
null: null,
|
|
232
|
-
Infinity: Infinity,
|
|
233
|
-
NaN: NaN,
|
|
234
|
-
// Primitive constructors & define functions (for bundled code with stripped imports)
|
|
235
|
-
...PRIMITIVE_SHIMS,
|
|
236
|
-
Lua: {
|
|
237
|
-
request: {
|
|
238
|
-
channel: options.channel ?? 'unknown',
|
|
239
|
-
webhook: options.webhookPayload ? { payload: options.webhookPayload } : undefined,
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
User: userService,
|
|
243
|
-
Products: productService,
|
|
244
|
-
Data: dataService,
|
|
245
|
-
Baskets: basketsService,
|
|
246
|
-
compressCode: compressCode,
|
|
247
|
-
Orders: orderService,
|
|
248
|
-
// Templates API with namespaces for different template types
|
|
249
|
-
Templates: {
|
|
250
|
-
whatsapp: whatsAppTemplatesService,
|
|
251
|
-
},
|
|
252
|
-
// CDN API
|
|
253
|
-
CDN: cdnService,
|
|
254
|
-
// Jobs API
|
|
255
|
-
Jobs: {
|
|
256
|
-
create: async (config) => {
|
|
257
|
-
// Convert execute function to string
|
|
258
|
-
const executeString = typeof config.execute === 'function' ? config.execute.toString() : config.execute;
|
|
259
|
-
// Create job with version and activation
|
|
260
|
-
return await jobService.createJobInstance({
|
|
261
|
-
name: config.name + '_' + Date.now(),
|
|
262
|
-
description: config.description,
|
|
263
|
-
schedule: config.schedule,
|
|
264
|
-
timeout: config.timeout,
|
|
265
|
-
retry: config.retry,
|
|
266
|
-
metadata: config.metadata,
|
|
267
|
-
dynamic: true,
|
|
268
|
-
version: {
|
|
269
|
-
version: '1.0.0',
|
|
270
|
-
description: config.description,
|
|
271
|
-
code: compressCode(executeString),
|
|
272
|
-
timeout: config.timeout,
|
|
273
|
-
retry: config.retry,
|
|
274
|
-
metadata: config.metadata,
|
|
275
|
-
},
|
|
276
|
-
activate: config.activate ?? true,
|
|
277
|
-
});
|
|
278
|
-
},
|
|
279
|
-
getJob: async (jobId) => jobService.getJob(jobId),
|
|
280
|
-
getAll: async (options = {}) => jobService.getAll(options),
|
|
281
|
-
},
|
|
282
|
-
// Device API (for sandbox — commands route through lua-api developer endpoint)
|
|
283
|
-
Device: {
|
|
284
|
-
sendCommand: async (deviceName, command, payload, timeout) => {
|
|
285
|
-
const { getDeviceInstance } = await import('../api/lazy-instances.js');
|
|
286
|
-
const deviceApi = await getDeviceInstance();
|
|
287
|
-
const response = await deviceApi.sendCommand(deviceName, command, payload, timeout || 30000);
|
|
288
|
-
if (!response.success)
|
|
289
|
-
throw new Error(response.error?.message || 'Device command failed');
|
|
290
|
-
return response.data;
|
|
291
|
-
},
|
|
292
|
-
listDevices: async () => {
|
|
293
|
-
const { getDeviceInstance } = await import('../api/lazy-instances.js');
|
|
294
|
-
const deviceApi = await getDeviceInstance();
|
|
295
|
-
const response = await deviceApi.getDevices();
|
|
296
|
-
return response.data?.devices || response.data || [];
|
|
297
|
-
},
|
|
298
|
-
getStatus: async (deviceName) => {
|
|
299
|
-
const { getDeviceInstance } = await import('../api/lazy-instances.js');
|
|
300
|
-
const deviceApi = await getDeviceInstance();
|
|
301
|
-
const response = await deviceApi.getDeviceStatus(deviceName);
|
|
302
|
-
return response.data;
|
|
303
|
-
},
|
|
304
|
-
},
|
|
305
|
-
// Environment variables function
|
|
306
|
-
env: (key) => envVars[key],
|
|
307
|
-
// Enums for status values
|
|
308
|
-
BasketStatus: BasketStatus,
|
|
309
|
-
OrderStatus: OrderStatus,
|
|
310
|
-
// AI Generation API (proxied to lua-api — isolated Gemini + Google Search; not agent chat)
|
|
311
|
-
AI: {
|
|
312
|
-
generate: async (promptOrOptions, content) => {
|
|
313
|
-
const { getAiInstance } = await import('../api/lazy-instances.js');
|
|
314
|
-
const ai = await getAiInstance();
|
|
315
|
-
return ai.generateForSandbox(promptOrOptions, content);
|
|
316
|
-
},
|
|
317
|
-
},
|
|
318
|
-
// Agent invocation API (proxied to lua-core's existing `/chat/generate/:agentId`).
|
|
319
|
-
// Matches the lua-core in-process `Agents.invoke` sandbox surface so the same
|
|
320
|
-
// skill/tool/job code runs in both environments.
|
|
321
|
-
Agents: {
|
|
322
|
-
invoke: async (targetAgentId, promptOrInput) => {
|
|
323
|
-
const { getAgentsInstance } = await import('../api/lazy-instances.js');
|
|
324
|
-
const agents = await getAgentsInstance();
|
|
325
|
-
return agents.invokeForSandbox(targetAgentId, promptOrInput);
|
|
326
|
-
},
|
|
327
|
-
},
|
|
328
|
-
process: {
|
|
329
|
-
env: envVars,
|
|
330
|
-
},
|
|
331
|
-
};
|
|
332
|
-
return sandbox;
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* Executes a tool in a VM sandbox.
|
|
336
|
-
* Supports both new bundled artifact format (dist-v2) and legacy execute function format.
|
|
337
|
-
*/
|
|
338
|
-
export async function executeTool(options) {
|
|
339
|
-
const { toolCode, inputs } = options;
|
|
340
|
-
// Create sandbox
|
|
341
|
-
const sandbox = createSandbox(options);
|
|
342
|
-
// Execute the code in the sandbox
|
|
343
|
-
const context = vm.createContext(sandbox);
|
|
344
|
-
injectPolyfillsIntoContext(context);
|
|
345
|
-
// Check if this is a new bundled artifact (contains __lua_primitive__)
|
|
346
|
-
const isBundledArtifact = toolCode.includes('__lua_primitive__');
|
|
347
|
-
if (isBundledArtifact) {
|
|
348
|
-
// New format: bundled module with primitive export
|
|
349
|
-
vm.runInContext(toolCode, context);
|
|
350
|
-
// Get the primitive from the module exports
|
|
351
|
-
const moduleExports = context.module.exports;
|
|
352
|
-
const primitive = moduleExports.default?.primitive || moduleExports.primitive;
|
|
353
|
-
if (!primitive || !primitive.execute) {
|
|
354
|
-
throw new Error('Tool artifact does not have a valid execute function');
|
|
355
|
-
}
|
|
356
|
-
try {
|
|
357
|
-
return await primitive.execute(inputs);
|
|
358
|
-
}
|
|
359
|
-
catch (e) {
|
|
360
|
-
console.error(e);
|
|
361
|
-
return { status: 'error', error: e.message };
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
else {
|
|
365
|
-
// Legacy format: raw execute function
|
|
366
|
-
const commonJsWrapper = `
|
|
367
|
-
const executeFunction = ${toolCode};
|
|
368
|
-
|
|
369
|
-
module.exports = async (input) => {
|
|
370
|
-
try {
|
|
371
|
-
return await executeFunction(input);
|
|
372
|
-
} catch(e) {
|
|
373
|
-
console.error(e);
|
|
374
|
-
return { status: 'error', error: e.message };
|
|
375
|
-
}
|
|
376
|
-
};
|
|
377
|
-
`;
|
|
378
|
-
vm.runInContext(commonJsWrapper, context);
|
|
379
|
-
const executeFunction = context.module.exports;
|
|
380
|
-
return await executeFunction(inputs);
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
/**
|
|
384
|
-
* Executes a webhook in a sandboxed environment.
|
|
385
|
-
* Supports both new bundled artifact format (dist-v2) and legacy execute function format.
|
|
386
|
-
*/
|
|
387
|
-
export async function executeWebhook(options) {
|
|
388
|
-
const { webhookCode, query, headers, body } = options;
|
|
389
|
-
// Create sandbox
|
|
390
|
-
const sandbox = createSandbox(options);
|
|
391
|
-
// Execute the code in the sandbox
|
|
392
|
-
const context = vm.createContext(sandbox);
|
|
393
|
-
injectPolyfillsIntoContext(context);
|
|
394
|
-
const event = {
|
|
395
|
-
query: query ?? {},
|
|
396
|
-
headers: headers ?? {},
|
|
397
|
-
body,
|
|
398
|
-
timestamp: new Date().toISOString(),
|
|
399
|
-
};
|
|
400
|
-
// Check if this is a new bundled artifact
|
|
401
|
-
const isBundledArtifact = webhookCode.includes('__lua_primitive__');
|
|
402
|
-
if (isBundledArtifact) {
|
|
403
|
-
// New format: bundled module with primitive export
|
|
404
|
-
vm.runInContext(webhookCode, context);
|
|
405
|
-
const moduleExports = context.module.exports;
|
|
406
|
-
const primitive = moduleExports.default?.primitive || moduleExports.primitive;
|
|
407
|
-
if (!primitive || !primitive.execute) {
|
|
408
|
-
throw new Error('Webhook artifact does not have a valid execute function');
|
|
409
|
-
}
|
|
410
|
-
try {
|
|
411
|
-
return await primitive.execute(event);
|
|
412
|
-
}
|
|
413
|
-
catch (e) {
|
|
414
|
-
console.error(e);
|
|
415
|
-
return { status: 'error', error: e.message };
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
else {
|
|
419
|
-
// Legacy format: raw execute function
|
|
420
|
-
const commonJsWrapper = `
|
|
421
|
-
const executeFunction = ${webhookCode};
|
|
422
|
-
|
|
423
|
-
module.exports = async (event) => {
|
|
424
|
-
try {
|
|
425
|
-
return await executeFunction(event);
|
|
426
|
-
} catch(e) {
|
|
427
|
-
console.error(e);
|
|
428
|
-
return { status: 'error', error: e.message };
|
|
429
|
-
}
|
|
430
|
-
};
|
|
431
|
-
`;
|
|
432
|
-
vm.runInContext(commonJsWrapper, context);
|
|
433
|
-
const executeFunction = context.module.exports;
|
|
434
|
-
return await executeFunction(event);
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Executes a job in a sandboxed environment.
|
|
439
|
-
* Supports both new bundled artifact format (dist-v2) and legacy execute function format.
|
|
440
|
-
*/
|
|
441
|
-
export async function executeJob(options) {
|
|
442
|
-
const { jobCode, jobData, apiKey, agentId } = options;
|
|
443
|
-
// Create sandbox
|
|
444
|
-
const sandbox = createSandbox(options);
|
|
445
|
-
// Execute the code in the sandbox
|
|
446
|
-
const context = vm.createContext(sandbox);
|
|
447
|
-
injectPolyfillsIntoContext(context);
|
|
448
|
-
// Create job instance
|
|
449
|
-
let jobInstance = undefined;
|
|
450
|
-
if (jobData) {
|
|
451
|
-
jobInstance = {
|
|
452
|
-
id: jobData.id || jobData.jobId,
|
|
453
|
-
jobId: jobData.jobId || jobData.id,
|
|
454
|
-
name: jobData.name,
|
|
455
|
-
schedule: jobData.schedule,
|
|
456
|
-
metadata: jobData.metadata || {},
|
|
457
|
-
data: jobData,
|
|
458
|
-
updateMetadata: async (newMetadata) => {
|
|
459
|
-
jobInstance.metadata = { ...jobInstance.metadata, ...newMetadata };
|
|
460
|
-
console.log('✅ Metadata updated:', jobInstance.metadata);
|
|
461
|
-
},
|
|
462
|
-
delete: async () => {
|
|
463
|
-
console.log('🗑️ Job.delete() called for:', jobInstance.jobId);
|
|
464
|
-
},
|
|
465
|
-
toJSON: () => jobData,
|
|
466
|
-
};
|
|
467
|
-
}
|
|
468
|
-
// Check if this is a new bundled artifact
|
|
469
|
-
const isBundledArtifact = jobCode.includes('__lua_primitive__');
|
|
470
|
-
if (isBundledArtifact) {
|
|
471
|
-
// New format: bundled module with primitive export
|
|
472
|
-
vm.runInContext(jobCode, context);
|
|
473
|
-
const moduleExports = context.module.exports;
|
|
474
|
-
const primitive = moduleExports.default?.primitive || moduleExports.primitive;
|
|
475
|
-
if (!primitive || !primitive.execute) {
|
|
476
|
-
throw new Error('Job artifact does not have a valid execute function');
|
|
477
|
-
}
|
|
478
|
-
try {
|
|
479
|
-
return await primitive.execute(jobInstance);
|
|
480
|
-
}
|
|
481
|
-
catch (e) {
|
|
482
|
-
console.error(e);
|
|
483
|
-
return { status: 'error', error: e.message };
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
else {
|
|
487
|
-
// Legacy format: raw execute function
|
|
488
|
-
const commonJsWrapper = `
|
|
489
|
-
const executeFunction = ${jobCode};
|
|
490
|
-
|
|
491
|
-
module.exports = async (job) => {
|
|
492
|
-
try {
|
|
493
|
-
return await executeFunction(job);
|
|
494
|
-
} catch(e) {
|
|
495
|
-
console.error(e);
|
|
496
|
-
return { status: 'error', error: e.message };
|
|
497
|
-
}
|
|
498
|
-
};
|
|
499
|
-
`;
|
|
500
|
-
vm.runInContext(commonJsWrapper, context);
|
|
501
|
-
const executeFunction = context.module.exports;
|
|
502
|
-
return await executeFunction(jobInstance);
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
/**
|
|
506
|
-
* Executes a preprocessor in a sandboxed environment.
|
|
507
|
-
* Supports both new bundled artifact format (dist-v2) and legacy execute function format.
|
|
508
|
-
*/
|
|
509
|
-
export async function executePreProcessor(options) {
|
|
510
|
-
const { processorCode, messages, channel, apiKey, agentId } = options;
|
|
511
|
-
// Create sandbox
|
|
512
|
-
const sandbox = createSandbox(options);
|
|
513
|
-
// Get user instance first (outside VM)
|
|
514
|
-
const UserDataApi = (await import('../api/user.data.api.service.js')).default;
|
|
515
|
-
const userService = new UserDataApi(BASE_URLS.API, apiKey, agentId);
|
|
516
|
-
const userInstance = await userService.get();
|
|
517
|
-
// Execute the code in the sandbox
|
|
518
|
-
const context = vm.createContext(sandbox);
|
|
519
|
-
injectPolyfillsIntoContext(context);
|
|
520
|
-
// Check if this is a new bundled artifact
|
|
521
|
-
const isBundledArtifact = processorCode.includes('__lua_primitive__');
|
|
522
|
-
if (isBundledArtifact) {
|
|
523
|
-
// New format: bundled module with primitive export
|
|
524
|
-
vm.runInContext(processorCode, context);
|
|
525
|
-
const moduleExports = context.module.exports;
|
|
526
|
-
const primitive = moduleExports.default?.primitive || moduleExports.primitive;
|
|
527
|
-
if (!primitive || !primitive.execute) {
|
|
528
|
-
throw new Error('PreProcessor artifact does not have a valid execute function');
|
|
529
|
-
}
|
|
530
|
-
try {
|
|
531
|
-
return await primitive.execute(userInstance, messages, channel);
|
|
532
|
-
}
|
|
533
|
-
catch (e) {
|
|
534
|
-
console.error(e);
|
|
535
|
-
return { status: 'error', error: e.message };
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
else {
|
|
539
|
-
// Legacy format: raw execute function
|
|
540
|
-
const commonJsWrapper = `
|
|
541
|
-
const executeFunction = ${processorCode};
|
|
542
|
-
|
|
543
|
-
module.exports = async (input) => {
|
|
544
|
-
try {
|
|
545
|
-
return await executeFunction(input.user, input.messages, input.channel);
|
|
546
|
-
} catch(e) {
|
|
547
|
-
console.error(e);
|
|
548
|
-
return { status: 'error', error: e.message };
|
|
549
|
-
}
|
|
550
|
-
};
|
|
551
|
-
`;
|
|
552
|
-
vm.runInContext(commonJsWrapper, context);
|
|
553
|
-
const executeFunction = context.module.exports;
|
|
554
|
-
return await executeFunction({ user: userInstance, messages, channel });
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
/**
|
|
558
|
-
* Executes a postprocessor in a sandboxed environment.
|
|
559
|
-
* Supports both new bundled artifact format (dist-v2) and legacy execute function format.
|
|
560
|
-
*/
|
|
561
|
-
export async function executePostProcessor(options) {
|
|
562
|
-
const { processorCode, message, response, channel, apiKey, agentId } = options;
|
|
563
|
-
// Create sandbox
|
|
564
|
-
const sandbox = createSandbox(options);
|
|
565
|
-
// Get user instance first (outside VM)
|
|
566
|
-
const UserDataApi = (await import('../api/user.data.api.service.js')).default;
|
|
567
|
-
const userService = new UserDataApi(BASE_URLS.API, apiKey, agentId);
|
|
568
|
-
const userInstance = await userService.get();
|
|
569
|
-
// Execute the code in the sandbox
|
|
570
|
-
const context = vm.createContext(sandbox);
|
|
571
|
-
injectPolyfillsIntoContext(context);
|
|
572
|
-
// Check if this is a new bundled artifact
|
|
573
|
-
const isBundledArtifact = processorCode.includes('__lua_primitive__');
|
|
574
|
-
if (isBundledArtifact) {
|
|
575
|
-
// New format: bundled module with primitive export
|
|
576
|
-
vm.runInContext(processorCode, context);
|
|
577
|
-
const moduleExports = context.module.exports;
|
|
578
|
-
const primitive = moduleExports.default?.primitive || moduleExports.primitive;
|
|
579
|
-
if (!primitive || !primitive.execute) {
|
|
580
|
-
throw new Error('PostProcessor artifact does not have a valid execute function');
|
|
581
|
-
}
|
|
582
|
-
try {
|
|
583
|
-
return await primitive.execute(userInstance, message, response, channel);
|
|
584
|
-
}
|
|
585
|
-
catch (e) {
|
|
586
|
-
console.error(e);
|
|
587
|
-
return response; // Return original response on error
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
else {
|
|
591
|
-
// Legacy format: raw execute function
|
|
592
|
-
const commonJsWrapper = `
|
|
593
|
-
const executeFunction = ${processorCode};
|
|
594
|
-
|
|
595
|
-
module.exports = async (input) => {
|
|
596
|
-
try {
|
|
597
|
-
return await executeFunction(input.user, input.message, input.response, input.channel);
|
|
598
|
-
} catch(e) {
|
|
599
|
-
console.error(e);
|
|
600
|
-
return { status: 'error', error: e.message };
|
|
601
|
-
}
|
|
602
|
-
};
|
|
603
|
-
`;
|
|
604
|
-
vm.runInContext(commonJsWrapper, context);
|
|
605
|
-
const executeFunction = context.module.exports;
|
|
606
|
-
return await executeFunction({ user: userInstance, message, response, channel });
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
/**
|
|
610
|
-
* Creates a custom console that broadcasts logs via WebSocket
|
|
611
|
-
*/
|
|
612
|
-
export function createBroadcastConsole(broadcastLog) {
|
|
613
|
-
return {
|
|
614
|
-
log: (...args) => {
|
|
615
|
-
const message = args.map((arg) => (typeof arg === 'object' ? JSON.stringify(arg) : String(arg))).join(' ');
|
|
616
|
-
broadcastLog({
|
|
617
|
-
type: 'log',
|
|
618
|
-
subType: 'info',
|
|
619
|
-
message: message,
|
|
620
|
-
timestamp: new Date().toISOString(),
|
|
621
|
-
id: Date.now().toString(),
|
|
622
|
-
});
|
|
623
|
-
// Also log to server console
|
|
624
|
-
console.log(...args);
|
|
625
|
-
},
|
|
626
|
-
error: (...args) => {
|
|
627
|
-
const message = args.map((arg) => (typeof arg === 'object' ? JSON.stringify(arg) : String(arg))).join(' ');
|
|
628
|
-
broadcastLog({
|
|
629
|
-
type: 'log',
|
|
630
|
-
subType: 'error',
|
|
631
|
-
message: message,
|
|
632
|
-
timestamp: new Date().toISOString(),
|
|
633
|
-
id: Date.now().toString(),
|
|
634
|
-
});
|
|
635
|
-
// Also log to server console
|
|
636
|
-
console.error(...args);
|
|
637
|
-
},
|
|
638
|
-
warn: (...args) => {
|
|
639
|
-
const message = args.map((arg) => (typeof arg === 'object' ? JSON.stringify(arg) : String(arg))).join(' ');
|
|
640
|
-
broadcastLog({
|
|
641
|
-
type: 'log',
|
|
642
|
-
subType: 'warn',
|
|
643
|
-
message: message,
|
|
644
|
-
timestamp: new Date().toISOString(),
|
|
645
|
-
id: Date.now().toString(),
|
|
646
|
-
});
|
|
647
|
-
// Also log to server console
|
|
648
|
-
console.warn(...args);
|
|
649
|
-
},
|
|
650
|
-
info: (...args) => {
|
|
651
|
-
const message = args.map((arg) => (typeof arg === 'object' ? JSON.stringify(arg) : String(arg))).join(' ');
|
|
652
|
-
broadcastLog({
|
|
653
|
-
type: 'log',
|
|
654
|
-
subType: 'info',
|
|
655
|
-
message: message,
|
|
656
|
-
timestamp: new Date().toISOString(),
|
|
657
|
-
id: Date.now().toString(),
|
|
658
|
-
});
|
|
659
|
-
// Also log to server console
|
|
660
|
-
console.info(...args);
|
|
661
|
-
},
|
|
662
|
-
};
|
|
663
|
-
}
|
|
664
|
-
//# sourceMappingURL=sandbox.js.map
|