@tdk-landscape/tdk-cli-core 1.3.14 → 1.3.22
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 +3 -3
- package/Tiltfile +144 -0
- package/discovery/AGENTS.md +362 -0
- package/discovery/TILT_DISCOVERY.star +424 -0
- package/discovery/Tiltfile +58 -0
- package/discovery/config.star +258 -0
- package/discovery/constants.star +127 -0
- package/discovery/deterministic.star +211 -0
- package/discovery/discovery_daemon.star +191 -0
- package/discovery/discovery_orchestrator.star +460 -0
- package/discovery/filtering.star +5 -0
- package/discovery/identity-management-backend/service.yaml +26 -0
- package/discovery/identity-management-frontend/service.yaml +29 -0
- package/discovery/identity-sdk/service.yaml +9 -0
- package/discovery/incremental_discovery.star +213 -0
- package/discovery/indexing.star +7 -0
- package/discovery/json_manifest_scanner.star +51 -0
- package/discovery/libraries.star +46 -0
- package/discovery/loading.star +23 -0
- package/discovery/manifest/constants.star +104 -0
- package/discovery/manifest/loading.star +386 -0
- package/discovery/manifest/normalize.star +281 -0
- package/discovery/manifest/validation.star +108 -0
- package/discovery/normalization.star +11 -0
- package/discovery/registry.star +544 -0
- package/discovery/resource_snapshot.py +382 -0
- package/discovery/resource_snapshot.star +143 -0
- package/discovery/schemas.star +1 -0
- package/discovery/services/platform/cdc/debezium/nats-connector/service.yaml +9 -0
- package/discovery/services/platform/cdc/nats-http-bridge/service.yaml +9 -0
- package/discovery/services/platform/orchestrator/orchestrator-glue-backend/service.yaml +26 -0
- package/discovery/services/platform/synthetic-monitor/service.yaml +9 -0
- package/discovery/test_resource_snapshot.py +251 -0
- package/discovery/validation.star +78 -0
- package/discovery/versioning.star +1 -0
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +11 -0
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +1 -2
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/project.d.ts.map +1 -1
- package/dist/commands/project.js +36 -41
- package/dist/commands/project.js.map +1 -1
- package/dist/commands/resource.d.ts.map +1 -1
- package/dist/commands/resource.js +51 -55
- package/dist/commands/resource.js.map +1 -1
- package/dist/commands/stack.d.ts.map +1 -1
- package/dist/commands/stack.js +22 -24
- package/dist/commands/stack.js.map +1 -1
- package/dist/commands/ui.d.ts.map +1 -1
- package/dist/commands/ui.js +1 -2
- package/dist/commands/ui.js.map +1 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +1 -2
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/upgrade.d.ts +8 -0
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +62 -21
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/generator/extension-fetch.d.ts +19 -0
- package/dist/generator/extension-fetch.d.ts.map +1 -1
- package/dist/generator/extension-fetch.js +71 -5
- package/dist/generator/extension-fetch.js.map +1 -1
- package/dist/generator/template-engine.d.ts +1 -0
- package/dist/generator/template-engine.d.ts.map +1 -1
- package/dist/generator/template-engine.js +50 -6
- package/dist/generator/template-engine.js.map +1 -1
- package/dist/utils/command-helpers.d.ts.map +1 -1
- package/dist/utils/command-helpers.js +7 -9
- package/dist/utils/command-helpers.js.map +1 -1
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.d.ts.map +1 -1
- package/dist/utils/constants.js +1 -0
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/errors.d.ts +2 -0
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +6 -1
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/paths.js +1 -1
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/project-features.d.ts.map +1 -1
- package/dist/utils/project-features.js +1 -1
- package/dist/utils/project-features.js.map +1 -1
- package/dist/utils/resource-features.d.ts.map +1 -1
- package/dist/utils/resource-features.js +2 -2
- package/dist/utils/resource-features.js.map +1 -1
- package/dist/utils/tar.js +4 -4
- package/dist/utils/tar.js.map +1 -1
- package/dist/utils/validation.d.ts +7 -0
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +9 -0
- package/dist/utils/validation.js.map +1 -1
- package/engine/AGENTS.md +705 -0
- package/engine/README.md +29 -0
- package/engine/REFACTORING_MANIFEST_SYSTEM.md +974 -0
- package/engine/Tiltfile +80 -0
- package/engine/assets/docker/golden-layers.Dockerfile +221 -0
- package/engine/assets/scripts/cleanup-completed-migrator-images.sh +37 -0
- package/engine/assets/scripts/cleanup-tilt-images.sh +120 -0
- package/engine/assets/scripts/mac-m1-resource-monitor.sh +121 -0
- package/engine/config.star +3 -0
- package/engine/docs/AUTODISCOVERY_TEST.md +182 -0
- package/engine/docs/C4-ARCHITECTURE-operations.md +396 -0
- package/engine/docs/C4-ARCHITECTURE-overview.md +284 -0
- package/engine/docs/C4-ARCHITECTURE.md +17 -0
- package/engine/docs/GOLDEN_IMAGE_INTEGRATION.md +349 -0
- package/engine/docs/MANIFEST_DRIVEN_ARCHITECTURE.md +357 -0
- package/engine/docs/README.md +284 -0
- package/engine/entrypoint.star +97 -0
- package/engine/lifecycle/orchestrator.star +260 -0
- package/engine/paths.star +717 -0
- package/engine/schemas/manifest-schema.json +301 -0
- package/engine/schemas/service-schema.json +301 -0
- package/engine/scripts/README.md +89 -0
- package/engine/scripts/build-and-publish-lib.sh +205 -0
- package/engine/scripts/check-lib-publish.sh +85 -0
- package/engine/scripts/debug-container.sh +258 -0
- package/engine/scripts/generate-manifest.sh +197 -0
- package/engine/spec.master +702 -0
- package/engine/spec.master.example +341 -0
- package/engine/topologies/README.md +34 -0
- package/engine/topologies/platform/docker/AGENTS.md +59 -0
- package/engine/topologies/platform/docker/auth/auth.star +167 -0
- package/engine/topologies/platform/docker/build/golden_image.star +37 -0
- package/engine/topologies/platform/docker/build/golden_image_build.star +82 -0
- package/engine/topologies/platform/docker/build/golden_image_constants.star +93 -0
- package/engine/topologies/platform/docker/build/golden_image_dockerfile.star +291 -0
- package/engine/topologies/platform/docker/compose/compose.star +636 -0
- package/engine/topologies/platform/docker/compose/compose_helpers.star +52 -0
- package/engine/topologies/platform/docker/compose/traefik_standalone.star +53 -0
- package/engine/topologies/platform/docker/config/bunignore.star +142 -0
- package/engine/topologies/platform/docker/config/dockerignore.star +150 -0
- package/engine/topologies/platform/docker/constants.star +170 -0
- package/engine/topologies/platform/docker/dockerfile/dockerfile.star +54 -0
- package/engine/topologies/platform/docker/generators/golden_docker_generator_v2.star +73 -0
- package/engine/topologies/platform/docker/index.star +27 -0
- package/engine/topologies/platform/docker/layers/bun_helpers.star +23 -0
- package/engine/topologies/platform/docker/layers/infisical/index.star +40 -0
- package/engine/topologies/platform/docker/layers/infisical/infisical_docker.star +262 -0
- package/engine/topologies/platform/docker/layers/l1_base_layers.star +87 -0
- package/engine/topologies/platform/docker/layers/l2_dependency_layers.star +125 -0
- package/engine/topologies/platform/docker/layers/l3_builder_layers.star +209 -0
- package/engine/topologies/platform/docker/layers/l4_runtime_layers.star +214 -0
- package/engine/topologies/platform/docker/layers/prisma/constants.star +135 -0
- package/engine/topologies/platform/docker/layers/prisma/db_readiness.star +96 -0
- package/engine/topologies/platform/docker/layers/prisma/filesystem_setup.star +109 -0
- package/engine/topologies/platform/docker/layers/prisma/migrate_script.star +98 -0
- package/engine/topologies/platform/docker/layers/prisma/prisma_build.star +126 -0
- package/engine/topologies/platform/docker/layers/prisma/prisma_runtime.star +161 -0
- package/engine/topologies/platform/docker/layers/prisma/secret_resolution.star +119 -0
- package/engine/topologies/platform/docker/networking/api_path_constants.star +230 -0
- package/engine/topologies/platform/docker/networking/sablier_container_cycle.star +27 -0
- package/engine/topologies/platform/docker/networking/traefik.star +232 -0
- package/engine/topologies/platform/docker/networking/traefik_constants.star +146 -0
- package/engine/topologies/platform/docker/networking/traefik_helpers.star +160 -0
- package/engine/topologies/platform/docker/secrets/infisical.star +135 -0
- package/engine/topologies/platform/net/proxy.star +4 -0
- package/engine/topologies/platform/registries/local.star +4 -0
- package/engine/topologies/platform/security/secrets.star +239 -0
- package/engine/topologies/platform/state/relational.star +4 -0
- package/engine/topologies/tilt/common/AGENTS.md +59 -0
- package/engine/topologies/tilt/common/utils.star +364 -0
- package/engine/topologies/tilt/common/utils_debug.star +69 -0
- package/engine/topologies/tilt/common/utils_deterministic.star +168 -0
- package/engine/topologies/tilt/common/utils_docker_networks.star +46 -0
- package/engine/topologies/tilt/common/utils_env.star +43 -0
- package/engine/topologies/tilt/common/utils_output.star +97 -0
- package/engine/topologies/tilt/config/AGENTS.md +68 -0
- package/engine/topologies/tilt/config/defaults.star +3 -0
- package/engine/topologies/tilt/config/feature_flags.star +10 -0
- package/engine/topologies/tilt/config/global.star +55 -0
- package/engine/topologies/tilt/config/profiles.star +382 -0
- package/engine/topologies/tilt/generators/agents_md.star +62 -0
- package/engine/topologies/tilt/generators/api_gateway.star +145 -0
- package/engine/topologies/tilt/generators/index.star +124 -0
- package/engine/topologies/tilt/generators/infisical/README.md +424 -0
- package/engine/topologies/tilt/generators/infisical/examples.star +312 -0
- package/engine/topologies/tilt/generators/infisical/index.star +57 -0
- package/engine/topologies/tilt/generators/infisical/machine_identity.star +420 -0
- package/engine/topologies/tilt/generators/infisical/organization.star +534 -0
- package/engine/topologies/tilt/generators/infisical/path_manager.star +476 -0
- package/engine/topologies/tilt/generators/infisical/secrets_generator.star +420 -0
- package/engine/topologies/tilt/generators/nginx_conf.star +143 -0
- package/engine/topologies/tilt/generators/npmrc.star +111 -0
- package/engine/topologies/tilt/generators/tsconfig.star +23 -0
- package/engine/topologies/tilt/generators/typescript/backend_library_tsconfig.star +71 -0
- package/engine/topologies/tilt/generators/typescript/backend_tsconfig.star +124 -0
- package/engine/topologies/tilt/generators/typescript/common.star +7 -0
- package/engine/topologies/tilt/generators/typescript/frontend_library_tsconfig.star +76 -0
- package/engine/topologies/tilt/generators/typescript/frontend_tsconfig.star +110 -0
- package/engine/topologies/tilt/generators/typescript/include.star +23 -0
- package/engine/topologies/tilt/generators/typescript/playwright_config.star +40 -0
- package/engine/topologies/tilt/generators/typescript/prisma_config.star +49 -0
- package/engine/topologies/tilt/generators/validators.star +853 -0
- package/engine/topologies/tilt/generators/vite/backend.star +78 -0
- package/engine/topologies/tilt/generators/vite/frontend.star +98 -0
- package/engine/topologies/tilt/generators/vite/generators.star +43 -0
- package/engine/topologies/tilt/generators/vite/helpers.star +244 -0
- package/engine/topologies/tilt/generators/vite/library.star +65 -0
- package/engine/topologies/tilt/generators/vite/sdk.star +73 -0
- package/engine/topologies/tilt/generators/vite/templates.star +737 -0
- package/engine/topologies/tilt/generators/vite_config.star +22 -0
- package/engine/topologies/tilt/manifest/AGENTS.md +61 -0
- package/engine/topologies/tilt/manifest/README.md +693 -0
- package/engine/topologies/tilt/manifest/__init__.star +218 -0
- package/engine/topologies/tilt/manifest/constants.star +252 -0
- package/engine/topologies/tilt/manifest/errors.star +266 -0
- package/engine/topologies/tilt/manifest/integration.star +339 -0
- package/engine/topologies/tilt/manifest/json_to_yaml.py +54 -0
- package/engine/topologies/tilt/manifest/loader.star +214 -0
- package/engine/topologies/tilt/manifest/mapper.star +227 -0
- package/engine/topologies/tilt/manifest/parser.star +400 -0
- package/engine/topologies/tilt/manifest/schema.star +462 -0
- package/engine/topologies/tilt/manifest/tests/test_integration.star +276 -0
- package/engine/topologies/tilt/manifest/tests/test_loader_parser.star +397 -0
- package/engine/topologies/tilt/manifest/tests/test_manifest.star +316 -0
- package/engine/topologies/tilt/manifest/tests/test_validator.star +470 -0
- package/engine/topologies/tilt/manifest/validator.star +717 -0
- package/engine/topologies/tilt/manifest/yaml_to_json.py +18 -0
- package/engine/topologies/tilt/resources/AGENTS.md +71 -0
- package/engine/topologies/tilt/resources/conditions.star +3 -0
- package/engine/topologies/tilt/resources/databases.star +244 -0
- package/engine/topologies/tilt/resources/declaration.star +3 -0
- package/engine/topologies/tilt/resources/deps.star +3 -0
- package/engine/topologies/tilt/resources/infra-loader.star +437 -0
- package/engine/topologies/tilt/resources/libs.star +30 -0
- package/engine/topologies/tilt/resources/libs_discovery.star +102 -0
- package/engine/topologies/tilt/resources/libs_paths.star +79 -0
- package/engine/topologies/tilt/resources/libs_resource_definition.star +151 -0
- package/engine/topologies/tilt/resources/libs_setup.star +164 -0
- package/engine/topologies/tilt/resources/libs_tsconfig.star +37 -0
- package/engine/topologies/tilt/resources/orchestrator/apply.star +77 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star +431 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_manifest_orchestration.star +81 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_migrator_orchestration.star +148 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_resource_validation.star +36 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_runtime_flags.star +44 -0
- package/engine/topologies/tilt/resources/orchestrator/builders/typescript.star +164 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/AGENTS.md +75 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/index.star +21 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/resolver.star +134 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/env.star +258 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/frontend.star +169 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/manifest_resource.star +524 -0
- package/engine/topologies/tilt/resources/orchestrator/helpers.star +33 -0
- package/engine/topologies/tilt/resources/orchestrator.star +54 -0
- package/engine/topologies/tilt/resources/ordering.star +3 -0
- package/engine/topologies/tilt/resources/triggers.star +3 -0
- package/engine/topologies/tilt/resources/watchers.star +299 -0
- package/engine/where-things-live.star +717 -0
- package/ext/Tiltfile +66 -0
- package/ext/ide-components/README.md +219 -0
- package/ext/ide-components/code_executor/server.py +268 -0
- package/ext/ide-components/code_viewer/server.py +206 -0
- package/ext/ide-components/config_inspector/server.py +1050 -0
- package/ext/ide-components/file_browser/server.py +285 -0
- package/ext/ide-components/shared/config_service.py +469 -0
- package/ext/ide-components/shared/file_utils.py +298 -0
- package/ext/ide-components/shared/http_utils.py +232 -0
- package/ext/ide-components/shared/static/styles.css +1334 -0
- package/ext/ide-components/shared/syntax_highlighter.py +140 -0
- package/ext/ide-components/shared/template_engine.py +123 -0
- package/ext/ide-components/shared/templates/base.html +121 -0
- package/ext/ide-components/shared/test_config_service.py +326 -0
- package/ext/ide-components/shared/tilt_integration.py +158 -0
- package/ext/ui-enhancements/cron-status-server.sh +49 -0
- package/ext/ui-enhancements/cron-status-tracker.sh +146 -0
- package/ext/ui-enhancements/extension.yaml +36 -0
- package/ext/ui-enhancements/tiltfile.py +99 -0
- package/ext/ui-enhancements/ui/cron-jobs-tab.css +396 -0
- package/ext/ui-enhancements/ui/help-panel.css +279 -0
- package/ext/ui-enhancements/ui/icons.css +125 -0
- package/ext/ui-enhancements/ui/tooltips.css +114 -0
- package/package.json +13 -9
- package/specs/specs/TILT_SERVICE_DEFAULTS.star +205 -0
- package/specs/specs/TILT_TECH_STACK.star +159 -0
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
# =============================================================================
|
|
2
|
+
# 📋 MANIFEST MODULE - SCHEMA DEFINITIONS
|
|
3
|
+
# =============================================================================
|
|
4
|
+
# Path: .tilt/topologies/tilt/manifest/schema.star
|
|
5
|
+
# Purpose: Complete manifest field schema with types, constraints, and validation
|
|
6
|
+
# Status: Phase 1 of manifest system refactoring
|
|
7
|
+
# =============================================================================
|
|
8
|
+
|
|
9
|
+
# === INLINED CONSTANTS for pure extension loading ===
|
|
10
|
+
VALID_STACKS = () # Stacks are project-specific, discovered dynamically
|
|
11
|
+
VALID_FEATURES = "api-client", "env-config", "api-index", "prisma", "nats", "redis", "infisical", "vitest", "traefik", "websocket", "graphql", "grpc", "vite-node", "maintenance"
|
|
12
|
+
PORT_RANGES = {"frontend": {"min": 3000, "max": 5999}, "backend": {"min": 4000, "max": 5999}, "worker": {"min": 6000, "max": 6999}, "migrator": {"min": 7000, "max": 7999}, "sdk": {"min": 3000, "max": 9999}, "library": {"min": 3000, "max": 9999}}
|
|
13
|
+
RUNTIME = "bun"
|
|
14
|
+
TRAEFIK_CONFIG = {"entrypoint": "web", "network": "traefik-public", "default_host": "localhost", "default_port": 8080, "tls_enabled": False, "entrypoints": ["web"], "middlewares": [], "tls": {"enabled": False}, "healthcheck_path": "/health", "healthcheck_interval": "10s", "healthcheck_timeout": "5s", "frontend_priority_base": 100}
|
|
15
|
+
BASE_PORT_FRONTEND = 3000
|
|
16
|
+
DEFAULTS = {}
|
|
17
|
+
|
|
18
|
+
# === END INLINED CONSTANTS ===
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
load("./constants.star",
|
|
22
|
+
"VALID_APP_TYPES",
|
|
23
|
+
"MANIFEST_DEFAULTS",
|
|
24
|
+
"VALIDATION_THRESHOLDS",
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# Import from master configs for tech stack and service defaults
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# Field type definitions
|
|
33
|
+
FIELD_TYPES = {
|
|
34
|
+
'string': 'string',
|
|
35
|
+
'integer': 'integer',
|
|
36
|
+
'boolean': 'boolean',
|
|
37
|
+
'list': 'list',
|
|
38
|
+
'dict': 'dict',
|
|
39
|
+
'enum': 'enum', # One of predefined values
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
# Complete manifest field schema
|
|
43
|
+
# Each field has: type, required, constraints, description
|
|
44
|
+
MANIFEST_SCHEMA = {
|
|
45
|
+
# Core Identification Fields
|
|
46
|
+
'appName': {
|
|
47
|
+
'type': 'string',
|
|
48
|
+
'required': True,
|
|
49
|
+
'constraints': {
|
|
50
|
+
'pattern': r'^[a-z][a-z0-9-]*$',
|
|
51
|
+
'min_length': 3,
|
|
52
|
+
'max_length': 50,
|
|
53
|
+
},
|
|
54
|
+
'description': 'Unique resource name in kebab-case',
|
|
55
|
+
'example': 'user-management-backend',
|
|
56
|
+
},
|
|
57
|
+
'appType': {
|
|
58
|
+
'type': 'enum',
|
|
59
|
+
'required': True,
|
|
60
|
+
'constraints': {
|
|
61
|
+
'values': VALID_APP_TYPES,
|
|
62
|
+
},
|
|
63
|
+
'description': 'Type of application',
|
|
64
|
+
'default': 'backend',
|
|
65
|
+
},
|
|
66
|
+
'stack': {
|
|
67
|
+
'type': 'enum',
|
|
68
|
+
'required': True,
|
|
69
|
+
'constraints': {
|
|
70
|
+
'values': VALID_STACKS,
|
|
71
|
+
},
|
|
72
|
+
'description': 'Technology stack this resource belongs to',
|
|
73
|
+
'example': 'user',
|
|
74
|
+
},
|
|
75
|
+
|
|
76
|
+
# Network Configuration
|
|
77
|
+
'port': {
|
|
78
|
+
'type': 'integer',
|
|
79
|
+
'required': True,
|
|
80
|
+
'constraints': {
|
|
81
|
+
'min': 1024,
|
|
82
|
+
'max': 65535,
|
|
83
|
+
'port_range_check': True, # Must be in appType range
|
|
84
|
+
},
|
|
85
|
+
'description': 'External resource port',
|
|
86
|
+
'example': 4000,
|
|
87
|
+
},
|
|
88
|
+
'internalPort': {
|
|
89
|
+
'type': 'integer',
|
|
90
|
+
'required': False,
|
|
91
|
+
'constraints': {
|
|
92
|
+
'min': 1,
|
|
93
|
+
'max': 65535,
|
|
94
|
+
'constant': True, # Should rarely change from default
|
|
95
|
+
},
|
|
96
|
+
'description': 'Internal container port',
|
|
97
|
+
'default': BASE_PORT_FRONTEND,
|
|
98
|
+
},
|
|
99
|
+
'replicas': {
|
|
100
|
+
'type': 'integer',
|
|
101
|
+
'required': False,
|
|
102
|
+
'constraints': {
|
|
103
|
+
'min': 1,
|
|
104
|
+
'max': VALIDATION_THRESHOLDS['max_replicas'],
|
|
105
|
+
},
|
|
106
|
+
'description': 'Number of container replicas for high availability',
|
|
107
|
+
'default': 1,
|
|
108
|
+
},
|
|
109
|
+
|
|
110
|
+
# Runtime Configuration
|
|
111
|
+
'runtime': {
|
|
112
|
+
'type': 'enum',
|
|
113
|
+
'required': False,
|
|
114
|
+
'constraints': {
|
|
115
|
+
'values': [RUNTIME, 'node', 'python', 'go'],
|
|
116
|
+
},
|
|
117
|
+
'description': 'Runtime environment',
|
|
118
|
+
'default': RUNTIME,
|
|
119
|
+
},
|
|
120
|
+
'features': {
|
|
121
|
+
'type': 'list',
|
|
122
|
+
'required': False,
|
|
123
|
+
'constraints': {
|
|
124
|
+
'item_type': 'enum',
|
|
125
|
+
'item_values': VALID_FEATURES,
|
|
126
|
+
'max_length': VALIDATION_THRESHOLDS['max_features'],
|
|
127
|
+
'unique': True,
|
|
128
|
+
},
|
|
129
|
+
'description': 'Feature flags enabling specific capabilities',
|
|
130
|
+
'default': [],
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
# Database Configuration
|
|
134
|
+
'databaseName': {
|
|
135
|
+
'type': 'string',
|
|
136
|
+
'required': False,
|
|
137
|
+
'constraints': {
|
|
138
|
+
'pattern': r'^[a-z][a-z0-9_]*$',
|
|
139
|
+
'max_length': 63,
|
|
140
|
+
},
|
|
141
|
+
'description': 'PostgreSQL database name (required if using prisma)',
|
|
142
|
+
'example': 'TDK_user',
|
|
143
|
+
},
|
|
144
|
+
|
|
145
|
+
# Dependency Configuration
|
|
146
|
+
'dependsOn': {
|
|
147
|
+
'type': 'list',
|
|
148
|
+
'required': False,
|
|
149
|
+
'constraints': {
|
|
150
|
+
'item_type': 'string',
|
|
151
|
+
'max_length': VALIDATION_THRESHOLDS['max_dependencies'],
|
|
152
|
+
},
|
|
153
|
+
'description': 'Other resources this resource depends on',
|
|
154
|
+
'default': [],
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
# Environment Configuration
|
|
158
|
+
'envVars': {
|
|
159
|
+
'type': 'dict',
|
|
160
|
+
'required': False,
|
|
161
|
+
'constraints': {
|
|
162
|
+
'max_keys': VALIDATION_THRESHOLDS['max_env_vars'],
|
|
163
|
+
},
|
|
164
|
+
'description': 'Environment variables for the resource',
|
|
165
|
+
'default': {},
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
# Frontend-Specific Fields
|
|
169
|
+
'backendName': {
|
|
170
|
+
'type': 'string',
|
|
171
|
+
'required': False,
|
|
172
|
+
'constraints': {
|
|
173
|
+
'pattern': r'^[a-z][a-z0-9-]*$',
|
|
174
|
+
},
|
|
175
|
+
'description': 'Associated backend resource name (required for frontends)',
|
|
176
|
+
'condition': "appType == 'frontend'", # Required only for frontends
|
|
177
|
+
'example': 'user-management-backend',
|
|
178
|
+
},
|
|
179
|
+
'basePath': {
|
|
180
|
+
'type': 'string',
|
|
181
|
+
'required': False,
|
|
182
|
+
'constraints': {
|
|
183
|
+
'pattern': r'^/[a-z][a-z0-9-]*$',
|
|
184
|
+
},
|
|
185
|
+
'description': 'URL base path for frontend (required for frontends)',
|
|
186
|
+
'condition': "appType == 'frontend'",
|
|
187
|
+
'example': '/users',
|
|
188
|
+
},
|
|
189
|
+
'targetPath': {
|
|
190
|
+
'type': 'string',
|
|
191
|
+
'required': False,
|
|
192
|
+
'description': 'Frontend build target path in container',
|
|
193
|
+
'default': '/usr/share/nginx/html',
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
# Advanced Configuration
|
|
197
|
+
'syncs': {
|
|
198
|
+
'type': 'list',
|
|
199
|
+
'required': False,
|
|
200
|
+
'constraints': {
|
|
201
|
+
'item_type': 'string',
|
|
202
|
+
},
|
|
203
|
+
'description': 'Custom sync paths (auto-computed if not provided)',
|
|
204
|
+
},
|
|
205
|
+
'startCommand': {
|
|
206
|
+
'type': 'string',
|
|
207
|
+
'required': False,
|
|
208
|
+
'description': 'Custom container start command (overrides default)',
|
|
209
|
+
'example': 'bun run start:prod',
|
|
210
|
+
},
|
|
211
|
+
'prismaClientPath': {
|
|
212
|
+
'type': 'string',
|
|
213
|
+
'required': False,
|
|
214
|
+
'description': 'Custom path for Prisma client',
|
|
215
|
+
},
|
|
216
|
+
'registryHost': {
|
|
217
|
+
'type': 'string',
|
|
218
|
+
'required': False,
|
|
219
|
+
'description': 'Custom npm registry host',
|
|
220
|
+
},
|
|
221
|
+
|
|
222
|
+
# Traefik Configuration
|
|
223
|
+
'traefik': {
|
|
224
|
+
'type': 'dict',
|
|
225
|
+
'required': False,
|
|
226
|
+
'schema': {
|
|
227
|
+
'pathPrefix': {
|
|
228
|
+
'type': 'string',
|
|
229
|
+
'required': True,
|
|
230
|
+
'constraints': {
|
|
231
|
+
'pattern': r'^/[a-z][a-z0-9/-]*$',
|
|
232
|
+
},
|
|
233
|
+
'description': 'URL path prefix for routing',
|
|
234
|
+
'example': '/api/v1/user-management',
|
|
235
|
+
},
|
|
236
|
+
'host': {
|
|
237
|
+
'type': 'string',
|
|
238
|
+
'required': False,
|
|
239
|
+
'description': 'Custom host for routing',
|
|
240
|
+
'example': 'user.backend.localhost',
|
|
241
|
+
},
|
|
242
|
+
'priority': {
|
|
243
|
+
'type': 'integer',
|
|
244
|
+
'required': False,
|
|
245
|
+
'constraints': {
|
|
246
|
+
'min': 1,
|
|
247
|
+
'max': 1000,
|
|
248
|
+
},
|
|
249
|
+
'description': 'Route priority (higher = evaluated first)',
|
|
250
|
+
'default': TRAEFIK_CONFIG['frontend_priority_base'],
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
'description': 'Traefik reverse proxy configuration',
|
|
254
|
+
},
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
# Cross-field validation constraints
|
|
258
|
+
CROSS_FIELD_CONSTRAINTS = {
|
|
259
|
+
'frontend_requires_backend': {
|
|
260
|
+
'condition': {'field': 'appType', 'equals': 'frontend'},
|
|
261
|
+
'requires': ['backendName', 'basePath'],
|
|
262
|
+
'severity': 'error',
|
|
263
|
+
'message': 'Frontend resources must specify backendName and basePath',
|
|
264
|
+
},
|
|
265
|
+
'prisma_requires_database': {
|
|
266
|
+
'condition': {'field': 'features', 'contains': 'prisma'},
|
|
267
|
+
'requires': ['databaseName'],
|
|
268
|
+
'severity': 'warning',
|
|
269
|
+
'message': 'Resources using Prisma should specify databaseName',
|
|
270
|
+
},
|
|
271
|
+
'traefik_for_backends': {
|
|
272
|
+
'condition': {'field': 'appType', 'equals': 'backend'},
|
|
273
|
+
'requires': ['traefik'],
|
|
274
|
+
'severity': 'warning',
|
|
275
|
+
'message': 'Backend resources should have Traefik configuration',
|
|
276
|
+
},
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
# Schema-level constraints
|
|
280
|
+
SCHEMA_CONSTRAINTS = {
|
|
281
|
+
'unique_ports': True,
|
|
282
|
+
'unique_resource_names': True,
|
|
283
|
+
'valid_dependency_references': True,
|
|
284
|
+
'no_circular_dependencies': True,
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
def get_field_schema(field_name):
|
|
288
|
+
"""
|
|
289
|
+
Get schema definition for a specific field.
|
|
290
|
+
|
|
291
|
+
Args:
|
|
292
|
+
field_name: Name of the field
|
|
293
|
+
|
|
294
|
+
Returns:
|
|
295
|
+
Field schema dict or None if field doesn't exist
|
|
296
|
+
"""
|
|
297
|
+
return MANIFEST_SCHEMA.get(field_name)
|
|
298
|
+
|
|
299
|
+
def get_required_fields(manifest=None):
|
|
300
|
+
"""
|
|
301
|
+
Get list of required fields.
|
|
302
|
+
|
|
303
|
+
Args:
|
|
304
|
+
manifest: Optional manifest dict to check conditional requirements
|
|
305
|
+
|
|
306
|
+
Returns:
|
|
307
|
+
List of required field names
|
|
308
|
+
"""
|
|
309
|
+
required = []
|
|
310
|
+
|
|
311
|
+
for field_name, schema in MANIFEST_SCHEMA.items():
|
|
312
|
+
if schema.get('required', False):
|
|
313
|
+
required.append(field_name)
|
|
314
|
+
|
|
315
|
+
# Check conditional requirements
|
|
316
|
+
if manifest and 'condition' in schema:
|
|
317
|
+
condition = schema['condition']
|
|
318
|
+
# Simple condition evaluation
|
|
319
|
+
if 'appType' in condition and manifest.get('appType') in condition:
|
|
320
|
+
required.append(field_name)
|
|
321
|
+
|
|
322
|
+
return required
|
|
323
|
+
|
|
324
|
+
def get_field_constraints(field_name):
|
|
325
|
+
"""
|
|
326
|
+
Get constraints for a specific field.
|
|
327
|
+
|
|
328
|
+
Args:
|
|
329
|
+
field_name: Name of the field
|
|
330
|
+
|
|
331
|
+
Returns:
|
|
332
|
+
Field constraints dict or None
|
|
333
|
+
"""
|
|
334
|
+
schema = get_field_schema(field_name)
|
|
335
|
+
if schema:
|
|
336
|
+
return schema.get('constraints', {})
|
|
337
|
+
return None
|
|
338
|
+
|
|
339
|
+
def get_default_value(field_name):
|
|
340
|
+
"""
|
|
341
|
+
Get default value for a field.
|
|
342
|
+
|
|
343
|
+
Args:
|
|
344
|
+
field_name: Name of the field
|
|
345
|
+
|
|
346
|
+
Returns:
|
|
347
|
+
Default value or None
|
|
348
|
+
"""
|
|
349
|
+
# Check MANIFEST_SCHEMA first
|
|
350
|
+
schema = get_field_schema(field_name)
|
|
351
|
+
if schema and 'default' in schema:
|
|
352
|
+
return schema['default']
|
|
353
|
+
|
|
354
|
+
# Fall back to MANIFEST_DEFAULTS
|
|
355
|
+
return MANIFEST_DEFAULTS.get(field_name)
|
|
356
|
+
|
|
357
|
+
def get_valid_values(field_name):
|
|
358
|
+
"""
|
|
359
|
+
Get list of valid values for enum fields.
|
|
360
|
+
|
|
361
|
+
Args:
|
|
362
|
+
field_name: Name of the field
|
|
363
|
+
|
|
364
|
+
Returns:
|
|
365
|
+
List of valid values or None
|
|
366
|
+
"""
|
|
367
|
+
schema = get_field_schema(field_name)
|
|
368
|
+
if schema and schema.get('type') == 'enum':
|
|
369
|
+
return schema.get('constraints', {}).get('values', [])
|
|
370
|
+
|
|
371
|
+
# Check for list item values
|
|
372
|
+
if schema and schema.get('type') == 'list':
|
|
373
|
+
if schema.get('constraints', {}).get('item_type') == 'enum':
|
|
374
|
+
return schema['constraints'].get('item_values', [])
|
|
375
|
+
|
|
376
|
+
return None
|
|
377
|
+
|
|
378
|
+
def is_field_required(field_name, manifest=None):
|
|
379
|
+
"""
|
|
380
|
+
Check if a field is required.
|
|
381
|
+
|
|
382
|
+
Args:
|
|
383
|
+
field_name: Name of the field
|
|
384
|
+
manifest: Optional manifest dict for conditional checks
|
|
385
|
+
|
|
386
|
+
Returns:
|
|
387
|
+
True if field is required
|
|
388
|
+
"""
|
|
389
|
+
schema = get_field_schema(field_name)
|
|
390
|
+
if not schema:
|
|
391
|
+
return False
|
|
392
|
+
|
|
393
|
+
if schema.get('required', False):
|
|
394
|
+
return True
|
|
395
|
+
|
|
396
|
+
# Check conditional requirements
|
|
397
|
+
if manifest and 'condition' in schema:
|
|
398
|
+
condition = schema['condition']
|
|
399
|
+
if 'appType' in condition:
|
|
400
|
+
app_type = manifest.get('appType', '')
|
|
401
|
+
if app_type in condition:
|
|
402
|
+
return True
|
|
403
|
+
|
|
404
|
+
return False
|
|
405
|
+
|
|
406
|
+
def is_field_deprecated(field_name):
|
|
407
|
+
"""
|
|
408
|
+
Check if a field is deprecated.
|
|
409
|
+
|
|
410
|
+
Args:
|
|
411
|
+
field_name: Name of the field
|
|
412
|
+
|
|
413
|
+
Returns:
|
|
414
|
+
True if field is deprecated
|
|
415
|
+
"""
|
|
416
|
+
schema = get_field_schema(field_name)
|
|
417
|
+
if schema:
|
|
418
|
+
return schema.get('deprecated', False)
|
|
419
|
+
return False
|
|
420
|
+
|
|
421
|
+
def get_all_field_names():
|
|
422
|
+
"""
|
|
423
|
+
Get list of all field names in schema.
|
|
424
|
+
|
|
425
|
+
Returns:
|
|
426
|
+
List of field names
|
|
427
|
+
"""
|
|
428
|
+
return list(MANIFEST_SCHEMA.keys())
|
|
429
|
+
|
|
430
|
+
def get_field_type(field_name):
|
|
431
|
+
"""
|
|
432
|
+
Get the type of a field.
|
|
433
|
+
|
|
434
|
+
Args:
|
|
435
|
+
field_name: Name of the field
|
|
436
|
+
|
|
437
|
+
Returns:
|
|
438
|
+
Field type string or None
|
|
439
|
+
"""
|
|
440
|
+
schema = get_field_schema(field_name)
|
|
441
|
+
if schema:
|
|
442
|
+
return schema.get('type')
|
|
443
|
+
return None
|
|
444
|
+
|
|
445
|
+
# Export schema utilities
|
|
446
|
+
ManifestSchema = struct(
|
|
447
|
+
MANIFEST_SCHEMA=MANIFEST_SCHEMA,
|
|
448
|
+
FIELD_TYPES=FIELD_TYPES,
|
|
449
|
+
CROSS_FIELD_CONSTRAINTS=CROSS_FIELD_CONSTRAINTS,
|
|
450
|
+
SCHEMA_CONSTRAINTS=SCHEMA_CONSTRAINTS,
|
|
451
|
+
get_field=get_field_schema,
|
|
452
|
+
get_required_fields=get_required_fields,
|
|
453
|
+
get_constraints=get_field_constraints,
|
|
454
|
+
get_default=get_default_value,
|
|
455
|
+
get_valid_values=get_valid_values,
|
|
456
|
+
is_required=is_field_required,
|
|
457
|
+
is_deprecated=is_field_deprecated,
|
|
458
|
+
get_all_fields=get_all_field_names,
|
|
459
|
+
get_type=get_field_type,
|
|
460
|
+
)
|
|
461
|
+
|
|
462
|
+
VALIDATION = {}
|