lua-cli 3.5.0-alpha.3 → 3.5.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -689
- package/dist/api/agent.api.service.d.ts +1 -8
- package/dist/api/agent.api.service.js +1 -11
- package/dist/api/agent.api.service.js.map +1 -1
- package/dist/api/auth.api.service.d.ts +1 -1
- package/dist/api/auth.api.service.js +1 -1
- package/dist/api/auth.api.service.js.map +1 -1
- package/dist/api/backup.api.service.d.ts +80 -0
- package/dist/api/backup.api.service.js +101 -0
- package/dist/api/backup.api.service.js.map +1 -0
- package/dist/api/basket.api.service.d.ts +4 -5
- package/dist/api/basket.api.service.js +13 -18
- package/dist/api/basket.api.service.js.map +1 -1
- package/dist/api/cdn.api.service.d.ts +2 -0
- package/dist/api/cdn.api.service.js +2 -0
- package/dist/api/cdn.api.service.js.map +1 -1
- package/dist/api/chat.api.service.d.ts +10 -2
- package/dist/api/chat.api.service.js +21 -2
- package/dist/api/chat.api.service.js.map +1 -1
- package/dist/api/credentials.js +5 -8
- package/dist/api/credentials.js.map +1 -1
- package/dist/api/custom.data.api.service.d.ts +3 -3
- package/dist/api/custom.data.api.service.js +9 -10
- package/dist/api/custom.data.api.service.js.map +1 -1
- package/dist/api/developer.api.service.d.ts +1 -1
- package/dist/api/developer.api.service.js +1 -1
- package/dist/api/developer.api.service.js.map +1 -1
- package/dist/api/http.client.js.map +1 -0
- package/dist/api/job.api.service.d.ts +2 -2
- package/dist/api/job.api.service.js +2 -2
- package/dist/api/job.api.service.js.map +1 -1
- package/dist/api/logs.api.service.d.ts +1 -1
- package/dist/api/logs.api.service.js +1 -1
- package/dist/api/logs.api.service.js.map +1 -1
- package/dist/api/marketplace.api.service.d.ts +6 -6
- package/dist/api/marketplace.api.service.js.map +1 -1
- package/dist/api/order.api.service.d.ts +3 -4
- package/dist/api/order.api.service.js +8 -10
- package/dist/api/order.api.service.js.map +1 -1
- package/dist/api/persona.api.service.d.ts +1 -1
- package/dist/api/persona.api.service.js +1 -1
- package/dist/api/persona.api.service.js.map +1 -1
- package/dist/api/postprocessor.api.service.d.ts +1 -1
- package/dist/api/postprocessor.api.service.js +1 -1
- package/dist/api/postprocessor.api.service.js.map +1 -1
- package/dist/api/preprocessor.api.service.d.ts +1 -1
- package/dist/api/preprocessor.api.service.js +1 -1
- package/dist/api/preprocessor.api.service.js.map +1 -1
- package/dist/api/products.api.service.d.ts +4 -4
- package/dist/api/products.api.service.js +6 -6
- package/dist/api/products.api.service.js.map +1 -1
- package/dist/api/resource.api.service.d.ts +76 -0
- package/dist/api/resource.api.service.js +74 -0
- package/dist/api/resource.api.service.js.map +1 -0
- package/dist/api/skills.api.service.d.ts +7 -15
- package/dist/api/skills.api.service.js +1 -1
- package/dist/api/skills.api.service.js.map +1 -1
- package/dist/api/tool.api.service.d.ts +1 -1
- package/dist/api/tool.api.service.js +1 -1
- package/dist/api/tool.api.service.js.map +1 -1
- package/dist/api/unifiedto.api.service.d.ts +1 -1
- package/dist/api/unifiedto.api.service.js +1 -1
- package/dist/api/unifiedto.api.service.js.map +1 -1
- package/dist/api/user.data.api.service.d.ts +7 -8
- package/dist/api/user.data.api.service.js +2 -3
- package/dist/api/user.data.api.service.js.map +1 -1
- package/dist/api/webhook.api.service.d.ts +1 -1
- package/dist/api/webhook.api.service.js +1 -1
- package/dist/api/webhook.api.service.js.map +1 -1
- package/dist/api/whatsapp-templates.api.service.d.ts +1 -1
- package/dist/api/whatsapp-templates.api.service.js +1 -1
- package/dist/api/whatsapp-templates.api.service.js.map +1 -1
- package/dist/api-exports.d.ts +14 -12
- package/dist/api-exports.js +8 -8
- package/dist/api-exports.js.map +1 -1
- package/dist/cli/command-definitions.js +32 -17
- package/dist/cli/command-definitions.js.map +1 -1
- package/dist/commands/admin.js +3 -24
- package/dist/commands/admin.js.map +1 -1
- package/dist/commands/agents.d.ts +8 -7
- package/dist/commands/agents.js +63 -21
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/channels.js +11 -23
- package/dist/commands/channels.js.map +1 -1
- package/dist/commands/chat.js +33 -47
- package/dist/commands/chat.js.map +1 -1
- package/dist/commands/chatClear.js +11 -41
- package/dist/commands/chatClear.js.map +1 -1
- package/dist/commands/compile.d.ts +26 -23
- package/dist/commands/compile.js +98 -403
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/completion.js +1 -1
- package/dist/commands/completion.js.map +1 -1
- package/dist/commands/deploy.js +55 -25
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/dev.js +29 -45
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/env.js +12 -25
- package/dist/commands/env.js.map +1 -1
- package/dist/commands/evals.js +3 -20
- package/dist/commands/evals.js.map +1 -1
- package/dist/commands/features.js +10 -23
- package/dist/commands/features.js.map +1 -1
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.js +1 -0
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +135 -19
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/integrations.js +26 -37
- package/dist/commands/integrations.js.map +1 -1
- package/dist/commands/jobs.js +32 -56
- package/dist/commands/jobs.js.map +1 -1
- package/dist/commands/logs.js +9 -20
- package/dist/commands/logs.js.map +1 -1
- package/dist/commands/marketplace.js +34 -52
- package/dist/commands/marketplace.js.map +1 -1
- package/dist/commands/mcp.js +10 -23
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/persona.js +43 -74
- package/dist/commands/persona.js.map +1 -1
- package/dist/commands/postprocessors.js +15 -28
- package/dist/commands/postprocessors.js.map +1 -1
- package/dist/commands/preprocessors.js +15 -28
- package/dist/commands/preprocessors.js.map +1 -1
- package/dist/commands/production.js +30 -63
- package/dist/commands/production.js.map +1 -1
- package/dist/commands/push.js +294 -1241
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/pushBackup.d.ts +22 -0
- package/dist/commands/pushBackup.js +133 -0
- package/dist/commands/pushBackup.js.map +1 -0
- package/dist/commands/resources.js +29 -72
- package/dist/commands/resources.js.map +1 -1
- package/dist/commands/skills.d.ts +1 -1
- package/dist/commands/skills.js +58 -70
- package/dist/commands/skills.js.map +1 -1
- package/dist/commands/sync.d.ts +1 -3
- package/dist/commands/sync.js +12 -24
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/test.js +135 -104
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/webhooks.js +15 -28
- package/dist/commands/webhooks.js.map +1 -1
- package/dist/compiler/agent-traverser.d.ts +104 -0
- package/dist/compiler/agent-traverser.js +311 -0
- package/dist/compiler/agent-traverser.js.map +1 -0
- package/dist/compiler/bundler.d.ts +42 -0
- package/dist/compiler/bundler.js +187 -0
- package/dist/compiler/bundler.js.map +1 -0
- package/dist/compiler/compiler.d.ts +177 -0
- package/dist/compiler/compiler.js +580 -0
- package/dist/compiler/compiler.js.map +1 -0
- package/dist/compiler/index.d.ts +36 -0
- package/dist/compiler/index.js +42 -0
- package/dist/compiler/index.js.map +1 -0
- package/dist/compiler/plugins/base.d.ts +264 -0
- package/dist/compiler/plugins/base.js +307 -0
- package/dist/compiler/plugins/base.js.map +1 -0
- package/dist/compiler/plugins/job.plugin.d.ts +33 -0
- package/dist/compiler/plugins/job.plugin.js +143 -0
- package/dist/compiler/plugins/job.plugin.js.map +1 -0
- package/dist/compiler/plugins/mcp-server.plugin.d.ts +50 -0
- package/dist/compiler/plugins/mcp-server.plugin.js +186 -0
- package/dist/compiler/plugins/mcp-server.plugin.js.map +1 -0
- package/dist/compiler/plugins/postprocessor.plugin.d.ts +20 -0
- package/dist/compiler/plugins/postprocessor.plugin.js +39 -0
- package/dist/compiler/plugins/postprocessor.plugin.js.map +1 -0
- package/dist/compiler/plugins/preprocessor.plugin.d.ts +20 -0
- package/dist/compiler/plugins/preprocessor.plugin.js +48 -0
- package/dist/compiler/plugins/preprocessor.plugin.js.map +1 -0
- package/dist/compiler/plugins/processor-base.d.ts +16 -0
- package/dist/compiler/plugins/processor-base.js +34 -0
- package/dist/compiler/plugins/processor-base.js.map +1 -0
- package/dist/compiler/plugins/registry.d.ts +61 -0
- package/dist/compiler/plugins/registry.js +107 -0
- package/dist/compiler/plugins/registry.js.map +1 -0
- package/dist/compiler/plugins/skill.plugin.d.ts +71 -0
- package/dist/compiler/plugins/skill.plugin.js +243 -0
- package/dist/compiler/plugins/skill.plugin.js.map +1 -0
- package/dist/compiler/plugins/tool.plugin.d.ts +67 -0
- package/dist/compiler/plugins/tool.plugin.js +279 -0
- package/dist/compiler/plugins/tool.plugin.js.map +1 -0
- package/dist/compiler/plugins/webhook.plugin.d.ts +37 -0
- package/dist/compiler/plugins/webhook.plugin.js +127 -0
- package/dist/compiler/plugins/webhook.plugin.js.map +1 -0
- package/dist/compiler/source-writer.d.ts +98 -0
- package/dist/compiler/source-writer.js +223 -0
- package/dist/compiler/source-writer.js.map +1 -0
- package/dist/compiler/types.d.ts +289 -0
- package/dist/compiler/types.js +20 -0
- package/dist/compiler/types.js.map +1 -0
- package/dist/compiler/utils/ast-helpers.d.ts +57 -0
- package/dist/compiler/utils/ast-helpers.js +164 -0
- package/dist/compiler/utils/ast-helpers.js.map +1 -0
- package/dist/compiler/utils/common.d.ts +23 -0
- package/dist/compiler/utils/common.js +66 -0
- package/dist/compiler/utils/common.js.map +1 -0
- package/dist/compiler/utils/file-discovery.d.ts +34 -0
- package/dist/compiler/utils/file-discovery.js +68 -0
- package/dist/compiler/utils/file-discovery.js.map +1 -0
- package/dist/compiler/utils/path-resolver.d.ts +25 -0
- package/dist/compiler/utils/path-resolver.js +66 -0
- package/dist/compiler/utils/path-resolver.js.map +1 -0
- package/dist/compiler/utils/schema-converter.d.ts +26 -0
- package/dist/compiler/utils/schema-converter.js +94 -0
- package/dist/compiler/utils/schema-converter.js.map +1 -0
- package/dist/config/compile.constants.d.ts +2 -22
- package/dist/config/compile.constants.js +2 -49
- package/dist/config/compile.constants.js.map +1 -1
- package/dist/config/constants.d.ts +18 -2
- package/dist/config/constants.js +28 -8
- package/dist/config/constants.js.map +1 -1
- package/dist/config/dev.constants.d.ts +0 -10
- package/dist/config/dev.constants.js +0 -10
- package/dist/config/dev.constants.js.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/instances/basket.instance.js.map +1 -0
- package/dist/instances/data.entry.instance.js.map +1 -0
- package/dist/instances/job.instance.js.map +1 -0
- package/dist/instances/order.instance.js.map +1 -0
- package/dist/instances/product.instance.js.map +1 -0
- package/dist/instances/product.pagination.instance.js.map +1 -0
- package/dist/instances/product.search.instance.js.map +1 -0
- package/dist/instances/user.instance.js.map +1 -0
- package/dist/interfaces/admin.d.ts +0 -38
- package/dist/interfaces/backup.d.ts +125 -0
- package/dist/interfaces/backup.js +8 -0
- package/dist/interfaces/backup.js.map +1 -0
- package/dist/interfaces/baskets.d.ts +0 -56
- package/dist/interfaces/common.d.ts +1 -0
- package/dist/interfaces/deploy.d.ts +0 -15
- package/dist/interfaces/index.d.ts +1 -1
- package/dist/interfaces/marketplace.d.ts +51 -0
- package/dist/interfaces/marketplace.js +1 -1
- package/dist/interfaces/marketplace.js.map +1 -1
- package/dist/interfaces/message.d.ts +0 -3
- package/dist/interfaces/orders.d.ts +0 -24
- package/dist/interfaces/postprocessors.d.ts +0 -18
- package/dist/interfaces/preprocessors.d.ts +0 -18
- package/dist/interfaces/skills.d.ts +61 -0
- package/dist/interfaces/user.d.ts +25 -0
- package/dist/interfaces/webhooks.d.ts +0 -9
- package/dist/primitives/base.handler.d.ts +106 -0
- package/dist/primitives/base.handler.js +370 -0
- package/dist/primitives/base.handler.js.map +1 -0
- package/dist/primitives/index.d.ts +47 -0
- package/dist/primitives/index.js +78 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/job.handler.d.ts +52 -0
- package/dist/primitives/job.handler.js +118 -0
- package/dist/primitives/job.handler.js.map +1 -0
- package/dist/primitives/mcp-server.handler.d.ts +54 -0
- package/dist/primitives/mcp-server.handler.js +91 -0
- package/dist/primitives/mcp-server.handler.js.map +1 -0
- package/dist/primitives/postprocessor.handler.d.ts +49 -0
- package/dist/primitives/postprocessor.handler.js +81 -0
- package/dist/primitives/postprocessor.handler.js.map +1 -0
- package/dist/primitives/preprocessor.handler.d.ts +54 -0
- package/dist/primitives/preprocessor.handler.js +95 -0
- package/dist/primitives/preprocessor.handler.js.map +1 -0
- package/dist/primitives/skill.handler.d.ts +44 -0
- package/dist/primitives/skill.handler.js +192 -0
- package/dist/primitives/skill.handler.js.map +1 -0
- package/dist/primitives/types.d.ts +72 -0
- package/dist/primitives/types.js +17 -0
- package/dist/primitives/types.js.map +1 -0
- package/dist/primitives/webhook.handler.d.ts +50 -0
- package/dist/primitives/webhook.handler.js +96 -0
- package/dist/primitives/webhook.handler.js.map +1 -0
- package/dist/services/auth.js +1 -2
- package/dist/services/auth.js.map +1 -1
- package/dist/services/sandbox.service.d.ts +103 -0
- package/dist/services/sandbox.service.js +479 -0
- package/dist/services/sandbox.service.js.map +1 -0
- package/dist/types/api-contracts.d.ts +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/skill.d.ts +8 -2
- package/dist/types/skill.js +8 -0
- package/dist/types/skill.js.map +1 -1
- package/dist/types/yaml.types.d.ts +69 -0
- package/dist/types/yaml.types.js +6 -0
- package/dist/types/yaml.types.js.map +1 -0
- package/dist/utils/artifact-loader.d.ts +108 -0
- package/dist/utils/artifact-loader.js +188 -0
- package/dist/utils/artifact-loader.js.map +1 -0
- package/dist/utils/backup-helpers.d.ts +122 -0
- package/dist/utils/backup-helpers.js +274 -0
- package/dist/utils/backup-helpers.js.map +1 -0
- package/dist/utils/cli.d.ts +8 -0
- package/dist/utils/cli.js +19 -2
- package/dist/utils/cli.js.map +1 -1
- package/dist/utils/command-utils.d.ts +42 -0
- package/dist/utils/command-utils.js +83 -0
- package/dist/utils/command-utils.js.map +1 -0
- package/dist/utils/deploy-helpers.d.ts +0 -29
- package/dist/utils/deploy-helpers.js +0 -70
- package/dist/utils/deploy-helpers.js.map +1 -1
- package/dist/utils/dev-api.d.ts +3 -99
- package/dist/utils/dev-api.js +3 -430
- package/dist/utils/dev-api.js.map +1 -1
- package/dist/utils/dev-server.d.ts +3 -1
- package/dist/utils/dev-server.js +69 -145
- package/dist/utils/dev-server.js.map +1 -1
- package/dist/utils/dev-watcher.d.ts +0 -1
- package/dist/utils/dev-watcher.js +23 -8
- package/dist/utils/dev-watcher.js.map +1 -1
- package/dist/utils/env-loader.utils.d.ts +10 -1
- package/dist/utils/env-loader.utils.js +39 -31
- package/dist/utils/env-loader.utils.js.map +1 -1
- package/dist/utils/files.d.ts +47 -3
- package/dist/utils/files.js +98 -40
- package/dist/utils/files.js.map +1 -1
- package/dist/utils/init-agent.js +1 -2
- package/dist/utils/init-agent.js.map +1 -1
- package/dist/utils/init-helpers.d.ts +2 -10
- package/dist/utils/init-helpers.js +9 -17
- package/dist/utils/init-helpers.js.map +1 -1
- package/dist/utils/init-prompts.d.ts +0 -8
- package/dist/utils/init-prompts.js +0 -22
- package/dist/utils/init-prompts.js.map +1 -1
- package/dist/utils/prompt-handler.d.ts +3 -0
- package/dist/utils/prompt-handler.js +13 -0
- package/dist/utils/prompt-handler.js.map +1 -1
- package/dist/utils/sandbox-storage.d.ts +6 -5
- package/dist/utils/sandbox-storage.js +12 -12
- package/dist/utils/sandbox-storage.js.map +1 -1
- package/dist/utils/sandbox.d.ts +7 -30
- package/dist/utils/sandbox.js +247 -223
- package/dist/utils/sandbox.js.map +1 -1
- package/dist/utils/semver.d.ts +12 -0
- package/dist/utils/semver.js +23 -0
- package/dist/utils/semver.js.map +1 -1
- package/dist/utils/sync-display.d.ts +9 -0
- package/dist/utils/sync-display.js +67 -0
- package/dist/utils/sync-display.js.map +1 -0
- package/dist/utils/sync-fetch.d.ts +23 -0
- package/dist/utils/sync-fetch.js +64 -0
- package/dist/utils/sync-fetch.js.map +1 -0
- package/dist/utils/sync-helpers.d.ts +4 -59
- package/dist/utils/sync-helpers.js +4 -206
- package/dist/utils/sync-helpers.js.map +1 -1
- package/dist/web/app.css +912 -186
- package/dist/web/app.js +46 -46
- package/docs/API_INDEX.md +100 -0
- package/docs/API_REFERENCE.md +773 -0
- package/docs/CLI_REFERENCE.md +924 -0
- package/docs/GETTING_STARTED.md +862 -0
- package/docs/README.md +270 -0
- package/docs/api/AI.md +882 -0
- package/docs/api/Baskets.md +511 -0
- package/docs/api/CDN.md +524 -0
- package/docs/api/Data.md +446 -0
- package/docs/api/Jobs.md +524 -0
- package/docs/api/LuaAgent.md +454 -0
- package/docs/api/LuaJob.md +604 -0
- package/docs/api/LuaSkill.md +396 -0
- package/docs/api/LuaTool.md +521 -0
- package/docs/api/LuaWebhook.md +601 -0
- package/docs/api/Orders.md +514 -0
- package/docs/api/PostProcessor.md +565 -0
- package/docs/api/PreProcessor.md +630 -0
- package/docs/api/Products.md +507 -0
- package/docs/api/Templates.md +662 -0
- package/docs/api/User.md +567 -0
- package/docs/archive/DEVELOPMENT_GUIDE_V1.md +1294 -0
- package/docs/compiler-v2/ASSESSMENT.md +205 -0
- package/docs/compiler-v2/TEST_PLAN.md +306 -0
- package/package.json +3 -7
- package/template/tsconfig.json +1 -1
- package/dist/common/basket.instance.js.map +0 -1
- package/dist/common/data.entry.instance.js.map +0 -1
- package/dist/common/http.client.js.map +0 -1
- package/dist/common/job.instance.js.map +0 -1
- package/dist/common/order.instance.js.map +0 -1
- package/dist/common/product.instance.js.map +0 -1
- package/dist/common/product.pagination.instance.js.map +0 -1
- package/dist/common/product.search.instance.js.map +0 -1
- package/dist/common/user.instance.js.map +0 -1
- package/dist/config/auth.constants.d.ts +0 -11
- package/dist/config/auth.constants.js +0 -12
- package/dist/config/auth.constants.js.map +0 -1
- package/dist/config/init.constants.d.ts +0 -15
- package/dist/config/init.constants.js +0 -20
- package/dist/config/init.constants.js.map +0 -1
- package/dist/interfaces/compile.d.ts +0 -12
- package/dist/interfaces/compile.js +0 -5
- package/dist/interfaces/compile.js.map +0 -1
- package/dist/types/compile.types.d.ts +0 -131
- package/dist/types/compile.types.js +0 -6
- package/dist/types/compile.types.js.map +0 -1
- package/dist/utils/agent-code-utils.d.ts +0 -25
- package/dist/utils/agent-code-utils.js +0 -107
- package/dist/utils/agent-code-utils.js.map +0 -1
- package/dist/utils/bundling.d.ts +0 -89
- package/dist/utils/bundling.js +0 -1068
- package/dist/utils/bundling.js.map +0 -1
- package/dist/utils/compile.d.ts +0 -116
- package/dist/utils/compile.js +0 -1062
- package/dist/utils/compile.js.map +0 -1
- package/dist/utils/deploy-api.d.ts +0 -26
- package/dist/utils/deploy-api.js +0 -54
- package/dist/utils/deploy-api.js.map +0 -1
- package/dist/utils/deployment.d.ts +0 -26
- package/dist/utils/deployment.js +0 -218
- package/dist/utils/deployment.js.map +0 -1
- package/dist/utils/dev-helpers.d.ts +0 -47
- package/dist/utils/dev-helpers.js +0 -82
- package/dist/utils/dev-helpers.js.map +0 -1
- package/dist/utils/job-management.d.ts +0 -27
- package/dist/utils/job-management.js +0 -248
- package/dist/utils/job-management.js.map +0 -1
- package/dist/utils/mcp-server-management.d.ts +0 -26
- package/dist/utils/mcp-server-management.js +0 -197
- package/dist/utils/mcp-server-management.js.map +0 -1
- package/dist/utils/postprocessor-management.d.ts +0 -9
- package/dist/utils/postprocessor-management.js +0 -117
- package/dist/utils/postprocessor-management.js.map +0 -1
- package/dist/utils/pre-bundle-jobs.d.ts +0 -27
- package/dist/utils/pre-bundle-jobs.js +0 -189
- package/dist/utils/pre-bundle-jobs.js.map +0 -1
- package/dist/utils/preprocessor-management.d.ts +0 -9
- package/dist/utils/preprocessor-management.js +0 -117
- package/dist/utils/preprocessor-management.js.map +0 -1
- package/dist/utils/push-api.d.ts +0 -15
- package/dist/utils/push-api.js +0 -49
- package/dist/utils/push-api.js.map +0 -1
- package/dist/utils/push-helpers.d.ts +0 -82
- package/dist/utils/push-helpers.js +0 -246
- package/dist/utils/push-helpers.js.map +0 -1
- package/dist/utils/skill-management.d.ts +0 -39
- package/dist/utils/skill-management.js +0 -299
- package/dist/utils/skill-management.js.map +0 -1
- package/dist/utils/test-helpers.d.ts +0 -33
- package/dist/utils/test-helpers.js +0 -84
- package/dist/utils/test-helpers.js.map +0 -1
- package/dist/utils/test-prompts.d.ts +0 -23
- package/dist/utils/test-prompts.js +0 -187
- package/dist/utils/test-prompts.js.map +0 -1
- package/dist/utils/tool-detection.d.ts +0 -19
- package/dist/utils/tool-detection.js +0 -125
- package/dist/utils/tool-detection.js.map +0 -1
- package/dist/utils/webhook-management.d.ts +0 -27
- package/dist/utils/webhook-management.js +0 -241
- package/dist/utils/webhook-management.js.map +0 -1
- /package/dist/{common → api}/http.client.d.ts +0 -0
- /package/dist/{common → api}/http.client.js +0 -0
- /package/dist/{common → instances}/basket.instance.d.ts +0 -0
- /package/dist/{common → instances}/basket.instance.js +0 -0
- /package/dist/{common → instances}/data.entry.instance.d.ts +0 -0
- /package/dist/{common → instances}/data.entry.instance.js +0 -0
- /package/dist/{common → instances}/job.instance.d.ts +0 -0
- /package/dist/{common → instances}/job.instance.js +0 -0
- /package/dist/{common → instances}/order.instance.d.ts +0 -0
- /package/dist/{common → instances}/order.instance.js +0 -0
- /package/dist/{common → instances}/product.instance.d.ts +0 -0
- /package/dist/{common → instances}/product.instance.js +0 -0
- /package/dist/{common → instances}/product.pagination.instance.d.ts +0 -0
- /package/dist/{common → instances}/product.pagination.instance.js +0 -0
- /package/dist/{common → instances}/product.search.instance.d.ts +0 -0
- /package/dist/{common → instances}/product.search.instance.js +0 -0
- /package/dist/{common → instances}/user.instance.d.ts +0 -0
- /package/dist/{common → instances}/user.instance.js +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for YAML configuration (lua.skill.yaml)
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Legacy single-skill format (for backward compatibility)
|
|
6
|
+
*/
|
|
7
|
+
export interface LegacyYamlConfigSkill {
|
|
8
|
+
name?: string;
|
|
9
|
+
version?: string;
|
|
10
|
+
skillId?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface YamlConfigAgent {
|
|
13
|
+
agentId?: string;
|
|
14
|
+
orgId?: string;
|
|
15
|
+
persona?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface YamlConfigSkill {
|
|
18
|
+
name: string;
|
|
19
|
+
version: string;
|
|
20
|
+
skillId: string;
|
|
21
|
+
}
|
|
22
|
+
export interface YamlConfigWebhook {
|
|
23
|
+
name: string;
|
|
24
|
+
version: string;
|
|
25
|
+
webhookId: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface YamlConfigJob {
|
|
29
|
+
name: string;
|
|
30
|
+
version: string;
|
|
31
|
+
jobId: string;
|
|
32
|
+
schedule?: any;
|
|
33
|
+
description?: string;
|
|
34
|
+
metadata?: any;
|
|
35
|
+
}
|
|
36
|
+
export interface YamlConfigPreprocessor {
|
|
37
|
+
name: string;
|
|
38
|
+
version: string;
|
|
39
|
+
preprocessorId: string;
|
|
40
|
+
description?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface YamlConfigPostprocessor {
|
|
43
|
+
name: string;
|
|
44
|
+
version: string;
|
|
45
|
+
postprocessorId: string;
|
|
46
|
+
description?: string;
|
|
47
|
+
}
|
|
48
|
+
export interface YamlConfigMCPServer {
|
|
49
|
+
name: string;
|
|
50
|
+
mcpServerId: string;
|
|
51
|
+
}
|
|
52
|
+
export interface YamlConfigBackup {
|
|
53
|
+
/** Hash of last pushed backup */
|
|
54
|
+
lastHash?: string;
|
|
55
|
+
/** Timestamp of last backup push */
|
|
56
|
+
lastPushedAt?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface YamlConfig {
|
|
59
|
+
skill?: LegacyYamlConfigSkill;
|
|
60
|
+
agent?: YamlConfigAgent;
|
|
61
|
+
skills?: YamlConfigSkill[];
|
|
62
|
+
webhooks?: YamlConfigWebhook[];
|
|
63
|
+
jobs?: YamlConfigJob[];
|
|
64
|
+
preprocessors?: YamlConfigPreprocessor[];
|
|
65
|
+
postprocessors?: YamlConfigPostprocessor[];
|
|
66
|
+
mcpServers?: YamlConfigMCPServer[];
|
|
67
|
+
/** Backup tracking information */
|
|
68
|
+
backup?: YamlConfigBackup;
|
|
69
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"yaml.types.js","sourceRoot":"","sources":["../../src/types/yaml.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAeF,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Artifact Loader Utilities
|
|
3
|
+
*
|
|
4
|
+
* Utilities for loading compilation artifacts from the new compiler output (dist-v2/).
|
|
5
|
+
* Used by push, test, and dev commands.
|
|
6
|
+
*/
|
|
7
|
+
import type { CompilationManifest, ManifestPrimitive } from '../compiler/types.js';
|
|
8
|
+
import { PrimitiveKind } from '../compiler/types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Load the compilation manifest from dist-v2/manifest.json.
|
|
11
|
+
*
|
|
12
|
+
* @param projectPath - Path to the project root (defaults to cwd)
|
|
13
|
+
* @returns The compilation manifest
|
|
14
|
+
* @throws Error if manifest not found or invalid
|
|
15
|
+
*/
|
|
16
|
+
export declare function loadManifest(projectPath?: string): CompilationManifest;
|
|
17
|
+
/**
|
|
18
|
+
* Check if the compilation output exists.
|
|
19
|
+
*
|
|
20
|
+
* @param projectPath - Path to the project root
|
|
21
|
+
* @returns true if dist-v2/manifest.json exists
|
|
22
|
+
*/
|
|
23
|
+
export declare function hasCompilationOutput(projectPath?: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Load a primitive artifact (bundled JS code) from disk.
|
|
26
|
+
*
|
|
27
|
+
* @param primitive - The primitive from the manifest
|
|
28
|
+
* @param projectPath - Path to the project root
|
|
29
|
+
* @returns The artifact code as a string
|
|
30
|
+
*/
|
|
31
|
+
export declare function loadArtifact(primitive: ManifestPrimitive, projectPath?: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* Load a primitive artifact and its metadata JSON.
|
|
34
|
+
*
|
|
35
|
+
* @param primitive - The primitive from the manifest
|
|
36
|
+
* @param projectPath - Path to the project root
|
|
37
|
+
* @returns Object with code and metadata
|
|
38
|
+
*/
|
|
39
|
+
export declare function loadArtifactWithMetadata(primitive: ManifestPrimitive, projectPath?: string): {
|
|
40
|
+
code: string;
|
|
41
|
+
metadata: Record<string, any>;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Load source map for a primitive (if it exists).
|
|
45
|
+
*
|
|
46
|
+
* @param primitive - The primitive from the manifest
|
|
47
|
+
* @param projectPath - Path to the project root
|
|
48
|
+
* @returns The source map string or null if not found
|
|
49
|
+
*/
|
|
50
|
+
export declare function loadSourceMap(primitive: ManifestPrimitive, projectPath?: string): string | null;
|
|
51
|
+
/**
|
|
52
|
+
* Compress code for pushing to server.
|
|
53
|
+
* Uses gzip + base64 encoding (matches server expectation).
|
|
54
|
+
*
|
|
55
|
+
* @param code - The artifact code to compress
|
|
56
|
+
* @returns Base64-encoded gzipped code
|
|
57
|
+
*/
|
|
58
|
+
export declare function compressForPush(code: string): string;
|
|
59
|
+
/**
|
|
60
|
+
* Decompress code from server format.
|
|
61
|
+
*
|
|
62
|
+
* @param compressed - Base64-encoded gzipped code
|
|
63
|
+
* @returns The decompressed code
|
|
64
|
+
*/
|
|
65
|
+
export declare function decompressFromServer(compressed: string): string;
|
|
66
|
+
/**
|
|
67
|
+
* Get primitives of a specific kind from the manifest.
|
|
68
|
+
*
|
|
69
|
+
* @param manifest - The compilation manifest
|
|
70
|
+
* @param kind - The primitive kind to filter by
|
|
71
|
+
* @returns Array of primitives matching the kind
|
|
72
|
+
*/
|
|
73
|
+
export declare function getPrimitivesByKind<T extends ManifestPrimitive>(manifest: CompilationManifest, kind: PrimitiveKind): T[];
|
|
74
|
+
/**
|
|
75
|
+
* Find a primitive by name and kind.
|
|
76
|
+
*
|
|
77
|
+
* @param manifest - The compilation manifest
|
|
78
|
+
* @param name - The primitive name
|
|
79
|
+
* @param kind - Optional kind to filter by
|
|
80
|
+
* @returns The primitive or undefined
|
|
81
|
+
*/
|
|
82
|
+
export declare function findPrimitive<T extends ManifestPrimitive>(manifest: CompilationManifest, name: string, kind?: T['kind']): T | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Get the agent name from the compilation manifest.
|
|
85
|
+
*
|
|
86
|
+
* @param projectPath - Path to the project root (defaults to cwd)
|
|
87
|
+
* @returns The agent name, or null if not found or no manifest
|
|
88
|
+
*/
|
|
89
|
+
export declare function getAgentName(projectPath?: string): string | null;
|
|
90
|
+
/**
|
|
91
|
+
* Get the agent persona from the compilation manifest.
|
|
92
|
+
*
|
|
93
|
+
* @param projectPath - Path to the project root (defaults to cwd)
|
|
94
|
+
* @returns The agent persona, or null if not found or no manifest
|
|
95
|
+
*/
|
|
96
|
+
export declare function getAgentPersona(projectPath?: string): string | null;
|
|
97
|
+
/**
|
|
98
|
+
* Load all artifacts of a specific kind.
|
|
99
|
+
*
|
|
100
|
+
* @param manifest - The compilation manifest
|
|
101
|
+
* @param kind - The primitive kind
|
|
102
|
+
* @param projectPath - Path to the project root
|
|
103
|
+
* @returns Array of { primitive, code } objects
|
|
104
|
+
*/
|
|
105
|
+
export declare function loadAllArtifactsOfKind(manifest: CompilationManifest, kind: PrimitiveKind, projectPath?: string): Array<{
|
|
106
|
+
primitive: ManifestPrimitive;
|
|
107
|
+
code: string;
|
|
108
|
+
}>;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Artifact Loader Utilities
|
|
3
|
+
*
|
|
4
|
+
* Utilities for loading compilation artifacts from the new compiler output (dist-v2/).
|
|
5
|
+
* Used by push, test, and dev commands.
|
|
6
|
+
*/
|
|
7
|
+
import fs from 'fs';
|
|
8
|
+
import path from 'path';
|
|
9
|
+
import zlib from 'zlib';
|
|
10
|
+
import { COMPILE_DIRS, COMPILE_FILES } from '../config/compile.constants.js';
|
|
11
|
+
// =============================================================================
|
|
12
|
+
// MANIFEST LOADING
|
|
13
|
+
// =============================================================================
|
|
14
|
+
/**
|
|
15
|
+
* Load the compilation manifest from dist-v2/manifest.json.
|
|
16
|
+
*
|
|
17
|
+
* @param projectPath - Path to the project root (defaults to cwd)
|
|
18
|
+
* @returns The compilation manifest
|
|
19
|
+
* @throws Error if manifest not found or invalid
|
|
20
|
+
*/
|
|
21
|
+
export function loadManifest(projectPath = process.cwd()) {
|
|
22
|
+
const manifestPath = path.join(projectPath, COMPILE_DIRS.DIST_V2, COMPILE_FILES.MANIFEST_JSON);
|
|
23
|
+
if (!fs.existsSync(manifestPath)) {
|
|
24
|
+
throw new Error(`Manifest not found at ${manifestPath}. ` +
|
|
25
|
+
`Run "lua compile" first to generate the compilation output.`);
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
const content = fs.readFileSync(manifestPath, 'utf-8');
|
|
29
|
+
return JSON.parse(content);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
throw new Error(`Failed to parse manifest: ${error.message}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Check if the compilation output exists.
|
|
37
|
+
*
|
|
38
|
+
* @param projectPath - Path to the project root
|
|
39
|
+
* @returns true if dist-v2/manifest.json exists
|
|
40
|
+
*/
|
|
41
|
+
export function hasCompilationOutput(projectPath = process.cwd()) {
|
|
42
|
+
const manifestPath = path.join(projectPath, COMPILE_DIRS.DIST_V2, COMPILE_FILES.MANIFEST_JSON);
|
|
43
|
+
return fs.existsSync(manifestPath);
|
|
44
|
+
}
|
|
45
|
+
// =============================================================================
|
|
46
|
+
// ARTIFACT LOADING
|
|
47
|
+
// =============================================================================
|
|
48
|
+
/**
|
|
49
|
+
* Load a primitive artifact (bundled JS code) from disk.
|
|
50
|
+
*
|
|
51
|
+
* @param primitive - The primitive from the manifest
|
|
52
|
+
* @param projectPath - Path to the project root
|
|
53
|
+
* @returns The artifact code as a string
|
|
54
|
+
*/
|
|
55
|
+
export function loadArtifact(primitive, projectPath = process.cwd()) {
|
|
56
|
+
const artifactPath = path.join(projectPath, COMPILE_DIRS.DIST_V2, primitive.path);
|
|
57
|
+
if (!fs.existsSync(artifactPath)) {
|
|
58
|
+
throw new Error(`Artifact not found: ${artifactPath}`);
|
|
59
|
+
}
|
|
60
|
+
return fs.readFileSync(artifactPath, 'utf-8');
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Load a primitive artifact and its metadata JSON.
|
|
64
|
+
*
|
|
65
|
+
* @param primitive - The primitive from the manifest
|
|
66
|
+
* @param projectPath - Path to the project root
|
|
67
|
+
* @returns Object with code and metadata
|
|
68
|
+
*/
|
|
69
|
+
export function loadArtifactWithMetadata(primitive, projectPath = process.cwd()) {
|
|
70
|
+
const code = loadArtifact(primitive, projectPath);
|
|
71
|
+
// Load metadata JSON (same name but .json extension)
|
|
72
|
+
const metadataPath = path.join(projectPath, COMPILE_DIRS.DIST_V2, path.join(path.dirname(primitive.path), path.basename(primitive.path, '.js') + '.json'));
|
|
73
|
+
let metadata = {};
|
|
74
|
+
if (fs.existsSync(metadataPath)) {
|
|
75
|
+
metadata = JSON.parse(fs.readFileSync(metadataPath, 'utf-8'));
|
|
76
|
+
}
|
|
77
|
+
return { code, metadata };
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Load source map for a primitive (if it exists).
|
|
81
|
+
*
|
|
82
|
+
* @param primitive - The primitive from the manifest
|
|
83
|
+
* @param projectPath - Path to the project root
|
|
84
|
+
* @returns The source map string or null if not found
|
|
85
|
+
*/
|
|
86
|
+
export function loadSourceMap(primitive, projectPath = process.cwd()) {
|
|
87
|
+
const sourceMapPath = path.join(projectPath, COMPILE_DIRS.DIST_V2, primitive.path + '.map');
|
|
88
|
+
if (!fs.existsSync(sourceMapPath)) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
return fs.readFileSync(sourceMapPath, 'utf-8');
|
|
92
|
+
}
|
|
93
|
+
// =============================================================================
|
|
94
|
+
// COMPRESSION (for push)
|
|
95
|
+
// =============================================================================
|
|
96
|
+
/**
|
|
97
|
+
* Compress code for pushing to server.
|
|
98
|
+
* Uses gzip + base64 encoding (matches server expectation).
|
|
99
|
+
*
|
|
100
|
+
* @param code - The artifact code to compress
|
|
101
|
+
* @returns Base64-encoded gzipped code
|
|
102
|
+
*/
|
|
103
|
+
export function compressForPush(code) {
|
|
104
|
+
const compressed = zlib.gzipSync(Buffer.from(code, 'utf-8'));
|
|
105
|
+
return compressed.toString('base64');
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Decompress code from server format.
|
|
109
|
+
*
|
|
110
|
+
* @param compressed - Base64-encoded gzipped code
|
|
111
|
+
* @returns The decompressed code
|
|
112
|
+
*/
|
|
113
|
+
export function decompressFromServer(compressed) {
|
|
114
|
+
const buffer = Buffer.from(compressed, 'base64');
|
|
115
|
+
const decompressed = zlib.gunzipSync(buffer);
|
|
116
|
+
return decompressed.toString('utf-8');
|
|
117
|
+
}
|
|
118
|
+
// =============================================================================
|
|
119
|
+
// PRIMITIVE FILTERING
|
|
120
|
+
// =============================================================================
|
|
121
|
+
/**
|
|
122
|
+
* Get primitives of a specific kind from the manifest.
|
|
123
|
+
*
|
|
124
|
+
* @param manifest - The compilation manifest
|
|
125
|
+
* @param kind - The primitive kind to filter by
|
|
126
|
+
* @returns Array of primitives matching the kind
|
|
127
|
+
*/
|
|
128
|
+
export function getPrimitivesByKind(manifest, kind) {
|
|
129
|
+
return manifest.primitives.filter(p => p.kind === kind);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Find a primitive by name and kind.
|
|
133
|
+
*
|
|
134
|
+
* @param manifest - The compilation manifest
|
|
135
|
+
* @param name - The primitive name
|
|
136
|
+
* @param kind - Optional kind to filter by
|
|
137
|
+
* @returns The primitive or undefined
|
|
138
|
+
*/
|
|
139
|
+
export function findPrimitive(manifest, name, kind) {
|
|
140
|
+
return manifest.primitives.find(p => {
|
|
141
|
+
if (kind && p.kind !== kind)
|
|
142
|
+
return false;
|
|
143
|
+
return p.name === name;
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
// =============================================================================
|
|
147
|
+
// AGENT INFO (from manifest)
|
|
148
|
+
// =============================================================================
|
|
149
|
+
/**
|
|
150
|
+
* Get the agent name from the compilation manifest.
|
|
151
|
+
*
|
|
152
|
+
* @param projectPath - Path to the project root (defaults to cwd)
|
|
153
|
+
* @returns The agent name, or null if not found or no manifest
|
|
154
|
+
*/
|
|
155
|
+
export function getAgentName(projectPath = process.cwd()) {
|
|
156
|
+
if (!hasCompilationOutput(projectPath))
|
|
157
|
+
return null;
|
|
158
|
+
return loadManifest(projectPath).agent?.name ?? null;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Get the agent persona from the compilation manifest.
|
|
162
|
+
*
|
|
163
|
+
* @param projectPath - Path to the project root (defaults to cwd)
|
|
164
|
+
* @returns The agent persona, or null if not found or no manifest
|
|
165
|
+
*/
|
|
166
|
+
export function getAgentPersona(projectPath = process.cwd()) {
|
|
167
|
+
if (!hasCompilationOutput(projectPath))
|
|
168
|
+
return null;
|
|
169
|
+
return loadManifest(projectPath).agent?.persona ?? null;
|
|
170
|
+
}
|
|
171
|
+
// =============================================================================
|
|
172
|
+
// BATCH LOADING
|
|
173
|
+
// =============================================================================
|
|
174
|
+
/**
|
|
175
|
+
* Load all artifacts of a specific kind.
|
|
176
|
+
*
|
|
177
|
+
* @param manifest - The compilation manifest
|
|
178
|
+
* @param kind - The primitive kind
|
|
179
|
+
* @param projectPath - Path to the project root
|
|
180
|
+
* @returns Array of { primitive, code } objects
|
|
181
|
+
*/
|
|
182
|
+
export function loadAllArtifactsOfKind(manifest, kind, projectPath = process.cwd()) {
|
|
183
|
+
return getPrimitivesByKind(manifest, kind).map(primitive => ({
|
|
184
|
+
primitive,
|
|
185
|
+
code: loadArtifact(primitive, projectPath),
|
|
186
|
+
}));
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=artifact-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-loader.js","sourceRoot":"","sources":["../../src/utils/artifact-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE7E,gFAAgF;AAChF,mBAAmB;AACnB,gFAAgF;AAEhF;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,cAAsB,OAAO,CAAC,GAAG,EAAE;IAC9D,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAE/F,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CACb,yBAAyB,YAAY,IAAI;YACzC,6DAA6D,CAC9D,CAAC;IACJ,CAAC;IAED,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACvD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,6BAA6B,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAChE,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,cAAsB,OAAO,CAAC,GAAG,EAAE;IACtE,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,YAAY,CAAC,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAC/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|
|
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 type { CompilationManifest, ProjectFile } from '../compiler/types.js';
|
|
8
|
+
import type { BackupFileRef, BackupManifest, BlobUpload } from '../interfaces/backup.js';
|
|
9
|
+
import type { YamlConfigBackup } from '../types/yaml.types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Calculate a hash for a string content.
|
|
12
|
+
*
|
|
13
|
+
* @param content - The content to hash
|
|
14
|
+
* @returns SHA-256 hash as hex string
|
|
15
|
+
*/
|
|
16
|
+
export declare function hashContent(content: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Calculate combined project hash from all project files.
|
|
19
|
+
* This hash is used to detect if the project has changed since last backup.
|
|
20
|
+
*
|
|
21
|
+
* @param projectFiles - Array of project files from the manifest
|
|
22
|
+
* @returns Combined hash of all file hashes (sorted for determinism)
|
|
23
|
+
*/
|
|
24
|
+
export declare function calculateProjectHash(projectFiles: ProjectFile[]): string;
|
|
25
|
+
/**
|
|
26
|
+
* Get the current project hash from the compilation manifest.
|
|
27
|
+
* Returns null if no manifest exists.
|
|
28
|
+
*
|
|
29
|
+
* @param projectPath - Path to the project root
|
|
30
|
+
* @returns The project hash or null
|
|
31
|
+
*/
|
|
32
|
+
export declare function getCurrentProjectHash(projectPath?: string): string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Load all project source files from dist-v2/sources/ directory.
|
|
35
|
+
*
|
|
36
|
+
* @param manifest - The compilation manifest
|
|
37
|
+
* @param projectPath - Path to the project root
|
|
38
|
+
* @returns Map of relative path -> file content
|
|
39
|
+
*/
|
|
40
|
+
export declare function loadProjectSources(manifest: CompilationManifest, projectPath?: string): Map<string, string>;
|
|
41
|
+
/**
|
|
42
|
+
* Load source content by hash from dist-v2/sources/ directory.
|
|
43
|
+
*
|
|
44
|
+
* @param hash - The content hash
|
|
45
|
+
* @param relativePath - Original relative path (for extension)
|
|
46
|
+
* @param projectPath - Path to the project root
|
|
47
|
+
* @returns The file content or null if not found
|
|
48
|
+
*/
|
|
49
|
+
export declare function loadSourceByHash(hash: string, relativePath: string, projectPath?: string): string | null;
|
|
50
|
+
/**
|
|
51
|
+
* Prepare file references (manifest entries) from the compilation output.
|
|
52
|
+
* No content included - just metadata for the manifest.
|
|
53
|
+
*
|
|
54
|
+
* @param projectPath - Path to the project root
|
|
55
|
+
* @returns Array of file references ready for manifest
|
|
56
|
+
*/
|
|
57
|
+
export declare function prepareFileRefs(projectPath?: string): BackupFileRef[];
|
|
58
|
+
/**
|
|
59
|
+
* Prepare blobs for upload from the compilation output.
|
|
60
|
+
* Only prepares blobs for the specified hashes (missing ones).
|
|
61
|
+
*
|
|
62
|
+
* @param hashes - Array of hashes to prepare (typically the missing ones)
|
|
63
|
+
* @param manifest - The compilation manifest
|
|
64
|
+
* @param projectPath - Path to the project root
|
|
65
|
+
* @returns Array of blobs ready for upload (hash + base64 content)
|
|
66
|
+
*/
|
|
67
|
+
export declare function prepareBlobsForUpload(hashes: string[], manifest: CompilationManifest, projectPath?: string): BlobUpload[];
|
|
68
|
+
/**
|
|
69
|
+
* Get all unique hashes from the manifest.
|
|
70
|
+
*
|
|
71
|
+
* @param projectPath - Path to the project root
|
|
72
|
+
* @returns Array of unique content hashes
|
|
73
|
+
*/
|
|
74
|
+
export declare function getAllFileHashes(projectPath?: string): string[];
|
|
75
|
+
/**
|
|
76
|
+
* Download multiple blobs in parallel from presigned URLs.
|
|
77
|
+
*
|
|
78
|
+
* @param urls - Map of hash -> presigned URL
|
|
79
|
+
* @param concurrency - Maximum number of parallel downloads (default: 10)
|
|
80
|
+
* @returns Map of hash -> content buffer
|
|
81
|
+
*/
|
|
82
|
+
export declare function downloadBlobsParallel(urls: Record<string, string>, concurrency?: number): Promise<Map<string, Buffer>>;
|
|
83
|
+
/**
|
|
84
|
+
* Restore project files from a backup manifest and downloaded blobs.
|
|
85
|
+
* Creates all directories and files in the target directory.
|
|
86
|
+
*
|
|
87
|
+
* @param manifest - The backup manifest (file references)
|
|
88
|
+
* @param blobs - Map of hash -> content buffer (downloaded blobs)
|
|
89
|
+
* @param targetDir - Target directory to restore to
|
|
90
|
+
* @param options - Optional settings
|
|
91
|
+
*/
|
|
92
|
+
export declare function restoreProjectFromBackup(manifest: BackupManifest, blobs: Map<string, Buffer>, targetDir: string, options?: {
|
|
93
|
+
overwrite?: boolean;
|
|
94
|
+
}): void;
|
|
95
|
+
/**
|
|
96
|
+
* Check which files would be created/overwritten by restore.
|
|
97
|
+
* Useful for showing user what will happen before restore.
|
|
98
|
+
*
|
|
99
|
+
* @param manifest - The backup manifest
|
|
100
|
+
* @param targetDir - Target directory to check against
|
|
101
|
+
* @returns Object with new files, existing files, and total count
|
|
102
|
+
*/
|
|
103
|
+
export declare function checkRestoreConflicts(manifest: BackupManifest, targetDir: string): {
|
|
104
|
+
newFiles: string[];
|
|
105
|
+
existingFiles: string[];
|
|
106
|
+
totalFiles: number;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Check if project backup is out of sync (local changes not pushed).
|
|
110
|
+
*
|
|
111
|
+
* @param currentHash - Current project hash from manifest
|
|
112
|
+
* @param tracking - Backup tracking from YAML
|
|
113
|
+
* @returns true if backup is out of sync
|
|
114
|
+
*/
|
|
115
|
+
export declare function isBackupOutOfSync(currentHash: string, tracking: YamlConfigBackup | undefined): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Create backup tracking object after successful push.
|
|
118
|
+
*
|
|
119
|
+
* @param projectHash - The hash of the pushed backup
|
|
120
|
+
* @returns YamlConfigBackup object for storing in YAML
|
|
121
|
+
*/
|
|
122
|
+
export declare function createBackupTracking(projectHash: string): YamlConfigBackup;
|