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
|
@@ -1,704 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Backup Helper Utilities
|
|
3
|
-
*
|
|
4
|
-
* Utilities for project backup operations using S3 blob storage.
|
|
5
|
-
* Content is stored in S3, keyed by content hash for deduplication.
|
|
6
|
-
*/
|
|
7
|
-
import fs from 'fs';
|
|
8
|
-
import path from 'path';
|
|
9
|
-
import { sha256Hex, combineFileHashes, downloadBlobs as sharedDownloadBlobs, restoreFromBlobs as sharedRestoreFromBlobs, resolveBackupFileTarget as sharedResolveBackupFileTarget, uploadBlobs as sharedUploadBlobs, } from '@lua/shared-source-sync';
|
|
10
|
-
// The compiler writes 16-char truncated SHA-256 hashes for project files into
|
|
11
|
-
// `manifest.projectFiles[].hash`. Those hashes flow into the backup manifest
|
|
12
|
-
// (via `prepareFileRefs`) and the local cache (via `writeBackupManifestCache`).
|
|
13
|
-
// For the conflict detector to compare like-with-like, disk hashes must use
|
|
14
|
-
// the same truncation. Importing the compiler's helper directly binds us to
|
|
15
|
-
// that single source of truth — if the compiler ever changes the format, the
|
|
16
|
-
// detector moves with it automatically. Do NOT swap this for the `hashContent`
|
|
17
|
-
// defined below in this file, which returns full 64-char hashes for a
|
|
18
|
-
// different purpose (project-level combined hash).
|
|
19
|
-
import { hashContent as hashProjectFile } from '../compiler/utils/common.js';
|
|
20
|
-
import { COMPILE_DIRS } from '../config/compile.constants.js';
|
|
21
|
-
import { loadManifest, hasCompilationOutput } from './artifact-loader.js';
|
|
22
|
-
import BackupApi from '../api/backup.api.service.js';
|
|
23
|
-
import { BASE_URLS } from '../config/constants.js';
|
|
24
|
-
// Cache records the file list + hashes from this machine's last successful
|
|
25
|
-
// `lua push backup`. The server does not expose historical manifests, so
|
|
26
|
-
// `lua sync --pull`'s conflict guard relies on this local record.
|
|
27
|
-
const BACKUP_CACHE_FILENAME = 'backup-manifest.json';
|
|
28
|
-
/**
|
|
29
|
-
* FULL 64-char SHA-256 — distinct from the truncated 16-char `hashContent`
|
|
30
|
-
* in `compiler/utils/common.ts`, which is used for per-file dedup. This one
|
|
31
|
-
* is used for the combined project hash where collision resistance matters
|
|
32
|
-
* more than key length.
|
|
33
|
-
*/
|
|
34
|
-
export function hashContent(content) {
|
|
35
|
-
return sha256Hex(content);
|
|
36
|
-
}
|
|
37
|
-
export function calculateProjectHash(projectFiles) {
|
|
38
|
-
return combineFileHashes(projectFiles);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Get the current project hash from the compilation manifest.
|
|
42
|
-
* Returns null if no manifest exists.
|
|
43
|
-
*
|
|
44
|
-
* @param projectPath - Path to the project root
|
|
45
|
-
* @returns The project hash or null
|
|
46
|
-
*/
|
|
47
|
-
export function getCurrentProjectHash(projectPath = process.cwd()) {
|
|
48
|
-
if (!hasCompilationOutput(projectPath))
|
|
49
|
-
return null;
|
|
50
|
-
const manifest = loadManifest(projectPath);
|
|
51
|
-
return calculateProjectHash(manifest.projectFiles);
|
|
52
|
-
}
|
|
53
|
-
// =============================================================================
|
|
54
|
-
// SOURCE LOADING
|
|
55
|
-
// =============================================================================
|
|
56
|
-
/**
|
|
57
|
-
* Load all project source files from dist-v2/sources/ directory.
|
|
58
|
-
*
|
|
59
|
-
* @param manifest - The compilation manifest
|
|
60
|
-
* @param projectPath - Path to the project root
|
|
61
|
-
* @returns Map of relative path -> file content
|
|
62
|
-
*/
|
|
63
|
-
export function loadProjectSources(manifest, projectPath = process.cwd()) {
|
|
64
|
-
const sourcesDir = path.join(projectPath, COMPILE_DIRS.DIST_V2, 'sources');
|
|
65
|
-
const sources = new Map();
|
|
66
|
-
for (const file of manifest.projectFiles) {
|
|
67
|
-
const ext = path.extname(file.relativePath) || '.txt';
|
|
68
|
-
const sourcePath = path.join(sourcesDir, `${file.hash}${ext}`);
|
|
69
|
-
if (fs.existsSync(sourcePath)) {
|
|
70
|
-
const content = fs.readFileSync(sourcePath, 'utf-8');
|
|
71
|
-
sources.set(file.relativePath, content);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return sources;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Load source content by hash from dist-v2/sources/ directory.
|
|
78
|
-
*
|
|
79
|
-
* @param hash - The content hash
|
|
80
|
-
* @param relativePath - Original relative path (for extension)
|
|
81
|
-
* @param projectPath - Path to the project root
|
|
82
|
-
* @returns The file content or null if not found
|
|
83
|
-
*/
|
|
84
|
-
export function loadSourceByHash(hash, relativePath, projectPath = process.cwd()) {
|
|
85
|
-
const sourcesDir = path.join(projectPath, COMPILE_DIRS.DIST_V2, 'sources');
|
|
86
|
-
const ext = path.extname(relativePath) || '.txt';
|
|
87
|
-
const sourcePath = path.join(sourcesDir, `${hash}${ext}`);
|
|
88
|
-
if (fs.existsSync(sourcePath)) {
|
|
89
|
-
return fs.readFileSync(sourcePath, 'utf-8');
|
|
90
|
-
}
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
// =============================================================================
|
|
94
|
-
// BLOB PREPARATION
|
|
95
|
-
// =============================================================================
|
|
96
|
-
/**
|
|
97
|
-
* Prepare file references (manifest entries) from the compilation output.
|
|
98
|
-
* No content included - just metadata for the manifest.
|
|
99
|
-
*
|
|
100
|
-
* @param projectPath - Path to the project root
|
|
101
|
-
* @returns Array of file references ready for manifest
|
|
102
|
-
*/
|
|
103
|
-
export function prepareFileRefs(projectPath = process.cwd()) {
|
|
104
|
-
const manifest = loadManifest(projectPath);
|
|
105
|
-
return manifest.projectFiles.map((file) => ({
|
|
106
|
-
relativePath: file.relativePath,
|
|
107
|
-
hash: file.hash,
|
|
108
|
-
size: file.size,
|
|
109
|
-
type: file.type,
|
|
110
|
-
...(file.external ? { external: true } : {}),
|
|
111
|
-
}));
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Reconcile `manifest.projectFiles` and `dist-v2/sources/` with the
|
|
115
|
-
* current on-disk state of each file. Fixes the pre-existing gap where
|
|
116
|
-
* compile's yaml-sync step rewrites `lua.skill.yaml` on disk AFTER the
|
|
117
|
-
* manifest was produced, leaving the manifest's hash for that file
|
|
118
|
-
* one bump behind disk. `pushBackupCommand` calls this before using
|
|
119
|
-
* the manifest so cache, uploaded blobs, and computed project hash all
|
|
120
|
-
* describe disk-as-it-is-now.
|
|
121
|
-
*
|
|
122
|
-
* Approach: iterate manifest.projectFiles, re-hash each from disk. For
|
|
123
|
-
* any file whose disk hash differs from the manifest hash, write a
|
|
124
|
-
* matching blob into sources/ under the new hash (so uploadBlobsToS3
|
|
125
|
-
* still finds content for the hash it's asked to upload) and update
|
|
126
|
-
* the manifest entry. Persist the manifest to disk at the end if
|
|
127
|
-
* anything changed. Orphaned old-hash files in sources/ are left in
|
|
128
|
-
* place — they're gitignored and clean up naturally on the next
|
|
129
|
-
* `npm run clean` or `lua compile`.
|
|
130
|
-
*
|
|
131
|
-
* Lenient: if a file in the manifest no longer exists on disk (user
|
|
132
|
-
* deleted), skip it; the next compile will drop it from the manifest.
|
|
133
|
-
*/
|
|
134
|
-
export function reconcileManifestWithDisk(projectPath = process.cwd()) {
|
|
135
|
-
const manifestPath = path.join(projectPath, COMPILE_DIRS.DIST_V2, 'manifest.json');
|
|
136
|
-
if (!fs.existsSync(manifestPath))
|
|
137
|
-
return;
|
|
138
|
-
const manifest = loadManifest(projectPath);
|
|
139
|
-
const sourcesDir = path.join(projectPath, COMPILE_DIRS.DIST_V2, 'sources');
|
|
140
|
-
fs.mkdirSync(sourcesDir, { recursive: true });
|
|
141
|
-
let changed = false;
|
|
142
|
-
for (const file of manifest.projectFiles) {
|
|
143
|
-
// External files live outside `projectPath` and aren't rewritten by
|
|
144
|
-
// compile's yaml-sync step, so there's nothing for the reconciler
|
|
145
|
-
// to fix. Their hash was computed from disk at compile time and
|
|
146
|
-
// already matches the manifest.
|
|
147
|
-
if (file.external)
|
|
148
|
-
continue;
|
|
149
|
-
const absPath = path.join(projectPath, file.relativePath);
|
|
150
|
-
if (!fs.existsSync(absPath))
|
|
151
|
-
continue;
|
|
152
|
-
let content;
|
|
153
|
-
try {
|
|
154
|
-
content = fs.readFileSync(absPath, 'utf-8');
|
|
155
|
-
}
|
|
156
|
-
catch {
|
|
157
|
-
continue; // unreadable; let a later compile handle it
|
|
158
|
-
}
|
|
159
|
-
const freshHash = hashProjectFile(content);
|
|
160
|
-
if (freshHash === file.hash)
|
|
161
|
-
continue;
|
|
162
|
-
// Drop new blob into sources/ under the fresh hash so the existing
|
|
163
|
-
// upload pipeline (keyed by hash → sources/<hash>.<ext>) can find it.
|
|
164
|
-
const ext = path.extname(file.relativePath) || '.txt';
|
|
165
|
-
const sourceTargetPath = path.join(sourcesDir, `${freshHash}${ext}`);
|
|
166
|
-
try {
|
|
167
|
-
fs.writeFileSync(sourceTargetPath, content, 'utf-8');
|
|
168
|
-
}
|
|
169
|
-
catch {
|
|
170
|
-
continue; // best-effort; skip this file
|
|
171
|
-
}
|
|
172
|
-
file.hash = freshHash;
|
|
173
|
-
file.size = Buffer.byteLength(content, 'utf-8');
|
|
174
|
-
changed = true;
|
|
175
|
-
}
|
|
176
|
-
if (changed) {
|
|
177
|
-
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2), 'utf-8');
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Upload blobs to S3 using presigned URLs. Reads content from the compiled
|
|
182
|
-
* `dist-v2/sources/<hash>.<ext>` sidecar directory.
|
|
183
|
-
*/
|
|
184
|
-
export async function uploadBlobsToS3(uploadUrls, manifest, projectPath = process.cwd(), onProgress, concurrency = 10) {
|
|
185
|
-
const hashes = Object.keys(uploadUrls);
|
|
186
|
-
if (hashes.length === 0)
|
|
187
|
-
return 0;
|
|
188
|
-
const hashToRelativePath = buildHashToRelativePathMap(manifest);
|
|
189
|
-
// Resolve up-front so a missing-source error surfaces before any network IO.
|
|
190
|
-
const contentByHash = new Map();
|
|
191
|
-
for (const hash of hashes) {
|
|
192
|
-
const relativePath = hashToRelativePath.get(hash);
|
|
193
|
-
if (!relativePath) {
|
|
194
|
-
throw new Error(`No file found in manifest for hash: ${hash}`);
|
|
195
|
-
}
|
|
196
|
-
const content = loadSourceByHash(hash, relativePath, projectPath);
|
|
197
|
-
if (!content) {
|
|
198
|
-
throw new Error(`Source file not found for hash: ${hash} (${relativePath})`);
|
|
199
|
-
}
|
|
200
|
-
contentByHash.set(hash, Buffer.from(content, 'utf-8'));
|
|
201
|
-
}
|
|
202
|
-
// Slice into per-batch invocations so the progress callback can fire
|
|
203
|
-
// between batches (shared's uploadBlobs returns a single count per call).
|
|
204
|
-
let uploaded = 0;
|
|
205
|
-
for (let i = 0; i < hashes.length; i += concurrency) {
|
|
206
|
-
const batchHashes = hashes.slice(i, i + concurrency);
|
|
207
|
-
const batchUrls = {};
|
|
208
|
-
for (const h of batchHashes)
|
|
209
|
-
batchUrls[h] = uploadUrls[h];
|
|
210
|
-
await sharedUploadBlobs({ uploadUrls: batchUrls, contentByHash, concurrency });
|
|
211
|
-
uploaded += batchHashes.length;
|
|
212
|
-
onProgress?.(uploaded, hashes.length);
|
|
213
|
-
}
|
|
214
|
-
return uploaded;
|
|
215
|
-
}
|
|
216
|
-
/**
|
|
217
|
-
* Build a map from content hash to the first matching relative path.
|
|
218
|
-
* Used by uploadBlobsToS3 to resolve file extensions for loadSourceByHash.
|
|
219
|
-
*/
|
|
220
|
-
function buildHashToRelativePathMap(manifest) {
|
|
221
|
-
const map = new Map();
|
|
222
|
-
for (const file of manifest.projectFiles) {
|
|
223
|
-
if (!map.has(file.hash)) {
|
|
224
|
-
map.set(file.hash, file.relativePath);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
return map;
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Get all unique hashes from the manifest.
|
|
231
|
-
*
|
|
232
|
-
* @param projectPath - Path to the project root
|
|
233
|
-
* @returns Array of unique content hashes
|
|
234
|
-
*/
|
|
235
|
-
export function getAllFileHashes(projectPath = process.cwd()) {
|
|
236
|
-
const manifest = loadManifest(projectPath);
|
|
237
|
-
// Use Set to deduplicate (same content may appear multiple times)
|
|
238
|
-
return [...new Set(manifest.projectFiles.map((f) => f.hash))];
|
|
239
|
-
}
|
|
240
|
-
// =============================================================================
|
|
241
|
-
// BLOB DOWNLOAD
|
|
242
|
-
// =============================================================================
|
|
243
|
-
export async function downloadBlobsParallel(urls, concurrency = 10) {
|
|
244
|
-
return sharedDownloadBlobs({ urls, concurrency });
|
|
245
|
-
}
|
|
246
|
-
// =============================================================================
|
|
247
|
-
// PROJECT RESTORATION
|
|
248
|
-
// =============================================================================
|
|
249
|
-
export function restoreProjectFromBackup(manifest, blobs, targetDir, options = {}) {
|
|
250
|
-
sharedRestoreFromBlobs(manifest, blobs, targetDir, options);
|
|
251
|
-
}
|
|
252
|
-
export function resolveBackupFileTarget(file, targetDir) {
|
|
253
|
-
return sharedResolveBackupFileTarget(file, targetDir);
|
|
254
|
-
}
|
|
255
|
-
/**
|
|
256
|
-
* Check which files would be created/overwritten by restore.
|
|
257
|
-
* Useful for showing user what will happen before restore.
|
|
258
|
-
*
|
|
259
|
-
* @param manifest - The backup manifest
|
|
260
|
-
* @param targetDir - Target directory to check against
|
|
261
|
-
* @returns Object with new files, existing files, and total count
|
|
262
|
-
*/
|
|
263
|
-
export function checkRestoreConflicts(manifest, targetDir) {
|
|
264
|
-
const newFiles = [];
|
|
265
|
-
const existingFiles = [];
|
|
266
|
-
for (const file of manifest.files) {
|
|
267
|
-
const filePath = resolveBackupFileTarget(file, targetDir);
|
|
268
|
-
if (fs.existsSync(filePath)) {
|
|
269
|
-
existingFiles.push(file.relativePath);
|
|
270
|
-
}
|
|
271
|
-
else {
|
|
272
|
-
newFiles.push(file.relativePath);
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
return {
|
|
276
|
-
newFiles,
|
|
277
|
-
existingFiles,
|
|
278
|
-
totalFiles: manifest.files.length,
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
// =============================================================================
|
|
282
|
-
// BACKUP TRACKING
|
|
283
|
-
// =============================================================================
|
|
284
|
-
/**
|
|
285
|
-
* Check if project backup is out of sync (local changes not pushed).
|
|
286
|
-
*
|
|
287
|
-
* @param currentHash - Current project hash from manifest
|
|
288
|
-
* @param tracking - Backup tracking from YAML
|
|
289
|
-
* @returns true if backup is out of sync
|
|
290
|
-
*/
|
|
291
|
-
export function isBackupOutOfSync(currentHash, tracking) {
|
|
292
|
-
if (!tracking?.lastHash)
|
|
293
|
-
return true;
|
|
294
|
-
return tracking.lastHash !== currentHash;
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* Create backup tracking object after successful push.
|
|
298
|
-
*
|
|
299
|
-
* @param projectHash - The hash of the pushed backup
|
|
300
|
-
* @returns YamlConfigBackup object for storing in YAML
|
|
301
|
-
*/
|
|
302
|
-
export function createBackupTracking(projectHash) {
|
|
303
|
-
return {
|
|
304
|
-
lastHash: projectHash,
|
|
305
|
-
lastPushedAt: new Date().toISOString(),
|
|
306
|
-
};
|
|
307
|
-
}
|
|
308
|
-
// =============================================================================
|
|
309
|
-
// LOCAL BACKUP MANIFEST CACHE
|
|
310
|
-
// =============================================================================
|
|
311
|
-
export function getBackupCachePath(projectPath = process.cwd()) {
|
|
312
|
-
return path.join(projectPath, '.lua', BACKUP_CACHE_FILENAME);
|
|
313
|
-
}
|
|
314
|
-
// Best-effort: a failed write must not fail the push that just succeeded
|
|
315
|
-
// on the server. A missing cache degrades `lua sync --pull` to its
|
|
316
|
-
// lenient "no-tracking" path.
|
|
317
|
-
export function writeBackupManifestCache(cache, projectPath = process.cwd()) {
|
|
318
|
-
const cachePath = getBackupCachePath(projectPath);
|
|
319
|
-
try {
|
|
320
|
-
fs.mkdirSync(path.dirname(cachePath), { recursive: true });
|
|
321
|
-
fs.writeFileSync(cachePath, JSON.stringify(cache, null, 2), 'utf-8');
|
|
322
|
-
}
|
|
323
|
-
catch (error) {
|
|
324
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
325
|
-
console.warn(`Could not write backup manifest cache: ${message}`);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
// Returns null when the cache is missing, unreadable, or malformed — the
|
|
329
|
-
// conflict guard treats null as the "no-tracking" signal.
|
|
330
|
-
export function readBackupManifestCache(projectPath = process.cwd()) {
|
|
331
|
-
const cachePath = getBackupCachePath(projectPath);
|
|
332
|
-
if (!fs.existsSync(cachePath))
|
|
333
|
-
return null;
|
|
334
|
-
try {
|
|
335
|
-
const raw = fs.readFileSync(cachePath, 'utf-8');
|
|
336
|
-
const parsed = JSON.parse(raw);
|
|
337
|
-
// Guard against hand-edits or version skew, not against our own writer.
|
|
338
|
-
if (typeof parsed.lastHash !== 'string' ||
|
|
339
|
-
typeof parsed.lastPushedAt !== 'string' ||
|
|
340
|
-
!Array.isArray(parsed.files) ||
|
|
341
|
-
!parsed.files.every((f) => f && typeof f.relativePath === 'string' && typeof f.hash === 'string')) {
|
|
342
|
-
return null;
|
|
343
|
-
}
|
|
344
|
-
return parsed;
|
|
345
|
-
}
|
|
346
|
-
catch {
|
|
347
|
-
return null;
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
// Files that `compileCommand()` silently rewrites as a side effect of
|
|
351
|
-
// its server-sync step (currently just `lua.skill.yaml`, which the
|
|
352
|
-
// handlers' `applySyncToYaml` bumps to match the server's active
|
|
353
|
-
// primitive versions). `syncCommand` runs compile at the top, so when
|
|
354
|
-
// the guard hashes disk after compile, yaml bytes already differ from
|
|
355
|
-
// the last-push cache even if the user hasn't edited anything.
|
|
356
|
-
//
|
|
357
|
-
// Skipping yaml here avoids a false-positive `Refusing to pull` abort
|
|
358
|
-
// on every multi-machine pull. The file is generated by compile, is
|
|
359
|
-
// restored from backup during the pull, and any real divergence is
|
|
360
|
-
// reconciled by `pushBackupCommand`'s `reconcileManifestWithDisk`
|
|
361
|
-
// before the next backup is pushed.
|
|
362
|
-
const COMPILE_MANAGED_FILES = new Set(['lua.skill.yaml']);
|
|
363
|
-
// Algorithm matches spec 2026-04-15-sync-pull-conflict-guard-design.md.
|
|
364
|
-
export function detectLocalConflictsForPull(incomingFiles, projectPath = process.cwd()) {
|
|
365
|
-
const cache = readBackupManifestCache(projectPath);
|
|
366
|
-
if (!cache) {
|
|
367
|
-
return { conflicts: [], warning: 'no-tracking' };
|
|
368
|
-
}
|
|
369
|
-
const cachedByPath = new Map(cache.files.map((f) => [f.relativePath, f.hash]));
|
|
370
|
-
const conflicts = new Set();
|
|
371
|
-
const projectRoot = path.resolve(projectPath);
|
|
372
|
-
for (const incoming of incomingFiles) {
|
|
373
|
-
// Skip files compile silently rewrites; see COMPILE_MANAGED_FILES.
|
|
374
|
-
if (COMPILE_MANAGED_FILES.has(incoming.relativePath))
|
|
375
|
-
continue;
|
|
376
|
-
// External (cross-root) files are restored into `.lua/external/`, not
|
|
377
|
-
// back to their workspace origin, so they can never conflict with an
|
|
378
|
-
// in-project file the user is editing. Skip them.
|
|
379
|
-
if (incoming.external)
|
|
380
|
-
continue;
|
|
381
|
-
const absPath = path.resolve(projectRoot, incoming.relativePath);
|
|
382
|
-
// Defense-in-depth: skip manifest entries whose path escapes the project
|
|
383
|
-
// directory (e.g. via `../`). The restore step is the real vulnerability
|
|
384
|
-
// surface here; silently skipping keeps the guard from hashing arbitrary
|
|
385
|
-
// files outside the project.
|
|
386
|
-
if (absPath !== projectRoot && !absPath.startsWith(projectRoot + path.sep)) {
|
|
387
|
-
continue;
|
|
388
|
-
}
|
|
389
|
-
if (!fs.existsSync(absPath))
|
|
390
|
-
continue;
|
|
391
|
-
let diskHash;
|
|
392
|
-
try {
|
|
393
|
-
const bytes = fs.readFileSync(absPath, 'utf-8');
|
|
394
|
-
// Must match the compiler's hash format — the cache and server manifest
|
|
395
|
-
// both contain 16-char truncated hashes (see hashProjectFile import above).
|
|
396
|
-
diskHash = hashProjectFile(bytes);
|
|
397
|
-
}
|
|
398
|
-
catch {
|
|
399
|
-
// Unreadable: flag as conflict so we don't silently overwrite.
|
|
400
|
-
conflicts.add(incoming.relativePath);
|
|
401
|
-
continue;
|
|
402
|
-
}
|
|
403
|
-
const cachedHash = cachedByPath.get(incoming.relativePath);
|
|
404
|
-
if (cachedHash !== undefined) {
|
|
405
|
-
if (diskHash !== cachedHash) {
|
|
406
|
-
conflicts.add(incoming.relativePath);
|
|
407
|
-
}
|
|
408
|
-
continue;
|
|
409
|
-
}
|
|
410
|
-
// Not in local cache — user created this file or pushed from a
|
|
411
|
-
// different machine. Flag only if pulling would actually change it.
|
|
412
|
-
if (diskHash !== incoming.hash) {
|
|
413
|
-
conflicts.add(incoming.relativePath);
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
return { conflicts: [...conflicts].sort(), warning: null };
|
|
417
|
-
}
|
|
418
|
-
// =============================================================================
|
|
419
|
-
// SYNC HELPERS
|
|
420
|
-
// =============================================================================
|
|
421
|
-
// Fetch the current backup manifest for sync's pre-pull conflict guard.
|
|
422
|
-
// Returns `fetched: null` when the request fails so the caller can warn
|
|
423
|
-
// about lenient-mode fallback without pattern-matching on exceptions.
|
|
424
|
-
export async function fetchBackupManifestForPull(apiKey, agentId) {
|
|
425
|
-
try {
|
|
426
|
-
const backupApi = new BackupApi(BASE_URLS.API, apiKey, agentId);
|
|
427
|
-
const response = await backupApi.getBackupManifest();
|
|
428
|
-
return { fetched: response.data ?? null };
|
|
429
|
-
}
|
|
430
|
-
catch {
|
|
431
|
-
return { fetched: null };
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
/**
|
|
435
|
-
* Pure freshness-decision logic for `checkServerBackupNewerThanLocal`.
|
|
436
|
-
* Exported so tests can exercise every branch (no-cache, server-fetch-
|
|
437
|
-
* failed, server-newer, server-older) without mocking HTTP.
|
|
438
|
-
*
|
|
439
|
-
* Uses `projectHash` as the freshness signal, not `createdAt`: the
|
|
440
|
-
* server's `BackupMetadata.createdAt` is the date the backup RECORD was
|
|
441
|
-
* first created (often days/weeks ago), not the last time it was
|
|
442
|
-
* updated. Comparing our local `lastPushedAt` to the record's
|
|
443
|
-
* `createdAt` produces wrong answers; comparing the project hashes
|
|
444
|
-
* answers the actual question ("did anyone push something I haven't
|
|
445
|
-
* seen?").
|
|
446
|
-
*
|
|
447
|
-
* Lenient: missing local cache → proceed (no baseline); missing server
|
|
448
|
-
* metadata → `checkFailed` so callers can warn-and-proceed rather than
|
|
449
|
-
* block on transient server errors.
|
|
450
|
-
*/
|
|
451
|
-
export function decideBackupFreshness(local, serverMetadata) {
|
|
452
|
-
if (!local)
|
|
453
|
-
return { serverNewer: false };
|
|
454
|
-
if (!serverMetadata)
|
|
455
|
-
return { serverNewer: false, checkFailed: true };
|
|
456
|
-
// If the server's current backup hash differs from the hash we last
|
|
457
|
-
// pushed, someone else pushed in between — refuse unless --force.
|
|
458
|
-
// Equal hashes mean nothing has changed server-side; a re-push of
|
|
459
|
-
// the same content is harmless (skipped by the later up-to-date
|
|
460
|
-
// check anyway).
|
|
461
|
-
const serverNewer = serverMetadata.projectHash !== local.lastHash;
|
|
462
|
-
return {
|
|
463
|
-
serverNewer,
|
|
464
|
-
serverProjectHash: serverMetadata.projectHash,
|
|
465
|
-
localLastHash: local.lastHash,
|
|
466
|
-
};
|
|
467
|
-
}
|
|
468
|
-
/**
|
|
469
|
-
* Compare the server's backup `createdAt` to this machine's local cache
|
|
470
|
-
* `lastPushedAt`. Used to detect the "another machine pushed while I
|
|
471
|
-
* wasn't looking" case before `lua push backup` uploads and overwrites
|
|
472
|
-
* the server side.
|
|
473
|
-
*/
|
|
474
|
-
export async function checkServerBackupNewerThanLocal(apiKey, agentId, projectPath = process.cwd()) {
|
|
475
|
-
const local = readBackupManifestCache(projectPath);
|
|
476
|
-
try {
|
|
477
|
-
const api = new BackupApi(BASE_URLS.API, apiKey, agentId);
|
|
478
|
-
const resp = await api.getBackupMetadata();
|
|
479
|
-
const metadata = resp.success && resp.data ? { projectHash: resp.data.projectHash } : null;
|
|
480
|
-
return decideBackupFreshness(local, metadata);
|
|
481
|
-
}
|
|
482
|
-
catch {
|
|
483
|
-
return decideBackupFreshness(local, null);
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
/**
|
|
487
|
-
* Check whether a backup exists for the given agent.
|
|
488
|
-
* Returns availability status along with basic metadata if a backup is found.
|
|
489
|
-
*
|
|
490
|
-
* @param apiKey - API key for authentication
|
|
491
|
-
* @param agentId - The agent whose backup to check
|
|
492
|
-
* @returns Object indicating availability and optional metadata
|
|
493
|
-
*/
|
|
494
|
-
export async function checkBackupAvailability(apiKey, agentId) {
|
|
495
|
-
try {
|
|
496
|
-
const backupApi = new BackupApi(BASE_URLS.API, apiKey, agentId);
|
|
497
|
-
const metadata = await backupApi.getBackupMetadata();
|
|
498
|
-
if (metadata.data && metadata.data.fileCount > 0) {
|
|
499
|
-
return {
|
|
500
|
-
available: true,
|
|
501
|
-
fileCount: metadata.data.fileCount,
|
|
502
|
-
lastPushedAt: metadata.data.createdAt,
|
|
503
|
-
};
|
|
504
|
-
}
|
|
505
|
-
return { available: false };
|
|
506
|
-
}
|
|
507
|
-
catch {
|
|
508
|
-
return { available: false };
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
/**
|
|
512
|
-
* Restore project source files from the S3 backup for `lua sync --pull`.
|
|
513
|
-
*
|
|
514
|
-
* Differs from `restoreProjectFromBackup` by byte-comparing before writing
|
|
515
|
-
* (so the caller can report what actually changed) and by classifying the
|
|
516
|
-
* restored files against `expectedPrimitives` to report backup coverage.
|
|
517
|
-
*/
|
|
518
|
-
export async function restoreFromBackupForSync(apiKey, agentId, expectedPrimitives = [], projectPath, preFetchedManifest) {
|
|
519
|
-
const targetDir = projectPath || process.cwd();
|
|
520
|
-
try {
|
|
521
|
-
const backupApi = new BackupApi(BASE_URLS.API, apiKey, agentId);
|
|
522
|
-
const manifest = preFetchedManifest ?? (await backupApi.getBackupManifest()).data ?? null;
|
|
523
|
-
if (!manifest || !manifest.files?.length) {
|
|
524
|
-
return {
|
|
525
|
-
success: false,
|
|
526
|
-
filesWritten: 0,
|
|
527
|
-
filesUnchanged: 0,
|
|
528
|
-
primitivesResolved: [],
|
|
529
|
-
primitivesUnresolved: [...expectedPrimitives],
|
|
530
|
-
backupAgeDays: null,
|
|
531
|
-
error: 'No backup manifest found',
|
|
532
|
-
};
|
|
533
|
-
}
|
|
534
|
-
const uniqueHashes = [...new Set(manifest.files.map((f) => f.hash))];
|
|
535
|
-
const urlsResponse = await backupApi.getBlobUrls(uniqueHashes);
|
|
536
|
-
if (!urlsResponse.data) {
|
|
537
|
-
return {
|
|
538
|
-
success: false,
|
|
539
|
-
filesWritten: 0,
|
|
540
|
-
filesUnchanged: 0,
|
|
541
|
-
primitivesResolved: [],
|
|
542
|
-
primitivesUnresolved: [...expectedPrimitives],
|
|
543
|
-
backupAgeDays: computeBackupAgeDays(manifest),
|
|
544
|
-
error: 'Failed to get download URLs',
|
|
545
|
-
};
|
|
546
|
-
}
|
|
547
|
-
const blobs = await downloadBlobsParallel(urlsResponse.data.urls, 10);
|
|
548
|
-
const { filesWritten, filesUnchanged, restoredContents } = writeBackupFilesWithByteCompare(manifest, blobs, targetDir);
|
|
549
|
-
const { resolved, unresolved } = classifyPrimitiveCoverage(expectedPrimitives, restoredContents);
|
|
550
|
-
// After a successful restore, disk contents now match the server
|
|
551
|
-
// manifest we just pulled. Sync the local cache so subsequent
|
|
552
|
-
// `lua sync --pull` runs don't mis-read the freshly-restored files
|
|
553
|
-
// as "user edits since last push".
|
|
554
|
-
updateCacheFromServerManifest(manifest, targetDir);
|
|
555
|
-
return {
|
|
556
|
-
success: true,
|
|
557
|
-
filesWritten,
|
|
558
|
-
filesUnchanged,
|
|
559
|
-
primitivesResolved: resolved,
|
|
560
|
-
primitivesUnresolved: unresolved,
|
|
561
|
-
backupAgeDays: computeBackupAgeDays(manifest),
|
|
562
|
-
};
|
|
563
|
-
}
|
|
564
|
-
catch (error) {
|
|
565
|
-
const message = error instanceof Error ? error.message : 'Unknown error';
|
|
566
|
-
return {
|
|
567
|
-
success: false,
|
|
568
|
-
filesWritten: 0,
|
|
569
|
-
filesUnchanged: 0,
|
|
570
|
-
primitivesResolved: [],
|
|
571
|
-
primitivesUnresolved: [...expectedPrimitives],
|
|
572
|
-
backupAgeDays: null,
|
|
573
|
-
error: message,
|
|
574
|
-
};
|
|
575
|
-
}
|
|
576
|
-
}
|
|
577
|
-
/**
|
|
578
|
-
* Write the local backup-manifest cache so it reflects the just-restored
|
|
579
|
-
* server state. Used by `restoreFromBackupForSync` to keep the conflict
|
|
580
|
-
* guard accurate on the next pull: without this, every file we just
|
|
581
|
-
* restored would show up as "modified since last push" on the very next
|
|
582
|
-
* `lua sync --pull` and trip the guard.
|
|
583
|
-
*
|
|
584
|
-
* Uses the server manifest's `createdAt` (when the backup was originally
|
|
585
|
-
* pushed) rather than "now", so the cache records a timestamp consistent
|
|
586
|
-
* with the state it's describing — not the moment we happened to pull it.
|
|
587
|
-
*/
|
|
588
|
-
export function updateCacheFromServerManifest(manifest, projectPath = process.cwd()) {
|
|
589
|
-
writeBackupManifestCache({
|
|
590
|
-
lastHash: manifest.projectHash,
|
|
591
|
-
lastPushedAt: manifest.createdAt,
|
|
592
|
-
// See `pushBackup.ts` — external entries are sandboxed during restore
|
|
593
|
-
// so the conflict guard never inspects them; keeping them out of the
|
|
594
|
-
// cache keeps disk comparisons aligned with the files we actually
|
|
595
|
-
// write back to their original location.
|
|
596
|
-
files: manifest.files
|
|
597
|
-
.filter((f) => !f.external)
|
|
598
|
-
.map((f) => ({
|
|
599
|
-
relativePath: f.relativePath,
|
|
600
|
-
hash: f.hash,
|
|
601
|
-
})),
|
|
602
|
-
}, projectPath);
|
|
603
|
-
}
|
|
604
|
-
/**
|
|
605
|
-
* Skip the write when disk bytes already match, so callers can distinguish
|
|
606
|
-
* "9 files restored" from "9 files matched disk, 0 written."
|
|
607
|
-
*/
|
|
608
|
-
function writeBackupFilesWithByteCompare(manifest, blobs, targetDir) {
|
|
609
|
-
let filesWritten = 0;
|
|
610
|
-
let filesUnchanged = 0;
|
|
611
|
-
const restoredContents = new Map();
|
|
612
|
-
for (const file of manifest.files) {
|
|
613
|
-
const content = blobs.get(file.hash);
|
|
614
|
-
if (!content) {
|
|
615
|
-
throw new Error(`Blob not found for hash: ${file.hash} (${file.relativePath})`);
|
|
616
|
-
}
|
|
617
|
-
// Namespace by `external` so in-project and external entries with
|
|
618
|
-
// the same relativePath (legitimately allowed by the M4 dedup fix)
|
|
619
|
-
// coexist in the Map instead of one silently clobbering the other.
|
|
620
|
-
// The consumer (classifyPrimitiveCoverage) is now aware of the
|
|
621
|
-
// prefix and strips it before its extension check.
|
|
622
|
-
restoredContents.set(makeRestoredContentsKey(file), content);
|
|
623
|
-
const filePath = resolveBackupFileTarget(file, targetDir);
|
|
624
|
-
if (fs.existsSync(filePath)) {
|
|
625
|
-
const existing = fs.readFileSync(filePath);
|
|
626
|
-
if (existing.equals(content)) {
|
|
627
|
-
filesUnchanged++;
|
|
628
|
-
continue;
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
632
|
-
fs.writeFileSync(filePath, content);
|
|
633
|
-
filesWritten++;
|
|
634
|
-
}
|
|
635
|
-
return { filesWritten, filesUnchanged, restoredContents };
|
|
636
|
-
}
|
|
637
|
-
/**
|
|
638
|
-
* Prefix the `relativePath` with a namespace derived from `file.external`
|
|
639
|
-
* so the restoredContents Map can hold both copies when a manifest has
|
|
640
|
-
* two entries sharing the same relativePath (M4 permits this — one
|
|
641
|
-
* in-project, one external/workspace-relative). Without the namespacing
|
|
642
|
-
* the second write silently clobbers the first in the Map, which
|
|
643
|
-
* breaks the design intent even though both files land correctly on
|
|
644
|
-
* disk (resolveBackupFileTarget uses `file.external`, not the Map key).
|
|
645
|
-
*
|
|
646
|
-
* `ext:` and `loc:` are deliberately short and unlikely to appear at
|
|
647
|
-
* the start of any real relativePath. Consumers MUST strip the prefix
|
|
648
|
-
* before interpreting the key as a filesystem-relative path.
|
|
649
|
-
*/
|
|
650
|
-
function makeRestoredContentsKey(file) {
|
|
651
|
-
return `${file.external ? 'ext:' : 'loc:'}${file.relativePath}`;
|
|
652
|
-
}
|
|
653
|
-
/**
|
|
654
|
-
* Strip the `ext:` / `loc:` namespace prefix from a
|
|
655
|
-
* restoredContents key, returning the raw relativePath. Safe to call
|
|
656
|
-
* on unprefixed strings (returns them unchanged) for forward
|
|
657
|
-
* compatibility with any older callers.
|
|
658
|
-
*/
|
|
659
|
-
function stripRestoredContentsKey(key) {
|
|
660
|
-
if (key.startsWith('ext:'))
|
|
661
|
-
return key.slice(4);
|
|
662
|
-
if (key.startsWith('loc:'))
|
|
663
|
-
return key.slice(4);
|
|
664
|
-
return key;
|
|
665
|
-
}
|
|
666
|
-
/**
|
|
667
|
-
* Fuzzy "does the backup define this primitive?" check: match the name as a
|
|
668
|
-
* quoted string literal in any restored .ts/.tsx/.js/.jsx file. Avoids pulling
|
|
669
|
-
* in a TS parser for sync reporting; can mis-classify when a name is built from
|
|
670
|
-
* a variable or appears in a string literal that isn't a primitive declaration.
|
|
671
|
-
*/
|
|
672
|
-
function classifyPrimitiveCoverage(expected, restoredContents) {
|
|
673
|
-
if (expected.length === 0) {
|
|
674
|
-
return { resolved: [], unresolved: [] };
|
|
675
|
-
}
|
|
676
|
-
const haystack = Array.from(restoredContents.entries())
|
|
677
|
-
// Strip the ext:/loc: namespace prefix the writer adds, then test
|
|
678
|
-
// the extension on the actual relativePath suffix. Without this,
|
|
679
|
-
// every prefixed key fails the regex and the haystack is empty.
|
|
680
|
-
.filter(([key]) => /\.(ts|tsx|js|jsx)$/.test(stripRestoredContentsKey(key)))
|
|
681
|
-
.map(([, buf]) => buf.toString('utf-8'))
|
|
682
|
-
.join('\n');
|
|
683
|
-
const resolved = [];
|
|
684
|
-
const unresolved = [];
|
|
685
|
-
for (const name of expected) {
|
|
686
|
-
const quoted = haystack.includes(`'${name}'`) || haystack.includes(`"${name}"`) || haystack.includes(`\`${name}\``);
|
|
687
|
-
if (quoted)
|
|
688
|
-
resolved.push(name);
|
|
689
|
-
else
|
|
690
|
-
unresolved.push(name);
|
|
691
|
-
}
|
|
692
|
-
return { resolved, unresolved };
|
|
693
|
-
}
|
|
694
|
-
function computeBackupAgeDays(manifest) {
|
|
695
|
-
const createdAt = manifest.createdAt;
|
|
696
|
-
if (!createdAt)
|
|
697
|
-
return null;
|
|
698
|
-
const created = new Date(createdAt).getTime();
|
|
699
|
-
if (!Number.isFinite(created))
|
|
700
|
-
return null;
|
|
701
|
-
const ageMs = Date.now() - created;
|
|
702
|
-
return Math.max(0, Math.floor(ageMs / (1000 * 60 * 60 * 24)));
|
|
703
|
-
}
|
|
704
|
-
//# sourceMappingURL=backup-helpers.js.map
|