@flisk-sh/flisk 0.0.0-stage → 1.3.190
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/CHANGELOG.md +492 -0
- package/LICENSE +21 -0
- package/README.md +479 -2
- package/Tiltfile +151 -0
- package/cli/bin/flisk.js +42 -0
- package/cli/dist/agent-runtimes/custom.js +335 -0
- package/cli/dist/agent-runtimes/registry.js +34 -0
- package/cli/dist/backend-frameworks/elysia.js +38 -0
- package/cli/dist/backend-frameworks/express.js +49 -0
- package/cli/dist/backend-frameworks/fastify.js +43 -0
- package/cli/dist/backend-frameworks/h3.js +37 -0
- package/cli/dist/backend-frameworks/koa.js +47 -0
- package/cli/dist/backend-frameworks/mcp.js +86 -0
- package/cli/dist/backend-frameworks/nestjs.js +55 -0
- package/cli/dist/backend-frameworks/registry.js +134 -0
- package/cli/dist/backend-frameworks/types.js +1 -0
- package/cli/dist/backend-languages/bun.js +76 -0
- package/cli/dist/backend-languages/go.js +125 -0
- package/cli/dist/backend-languages/node.js +122 -0
- package/cli/dist/backend-languages/python.js +94 -0
- package/cli/dist/backend-languages/registry.js +37 -0
- package/cli/dist/backend-languages/rust.js +82 -0
- package/cli/dist/backend-languages/types.js +1 -0
- package/cli/dist/cli.js +29 -0
- package/cli/dist/commands/__tests__/project-e2e-helpers.js +49 -0
- package/cli/dist/commands/__tests__/ui-loading-screen.test.js +16 -0
- package/cli/dist/commands/agent.js +182 -0
- package/cli/dist/commands/completion-candidates.js +116 -0
- package/cli/dist/commands/completion.js +843 -0
- package/cli/dist/commands/config.js +362 -0
- package/cli/dist/commands/doctor.js +1504 -0
- package/cli/dist/commands/down.js +114 -0
- package/cli/dist/commands/eject.js +108 -0
- package/cli/dist/commands/help.js +152 -0
- package/cli/dist/commands/import.js +164 -0
- package/cli/dist/commands/logs.js +119 -0
- package/cli/dist/commands/maintainers.js +102 -0
- package/cli/dist/commands/mcp.js +28 -0
- package/cli/dist/commands/networks.js +306 -0
- package/cli/dist/commands/project.js +447 -0
- package/cli/dist/commands/projects.js +103 -0
- package/cli/dist/commands/registry.js +53 -0
- package/cli/dist/commands/resource.js +992 -0
- package/cli/dist/commands/resources.js +127 -0
- package/cli/dist/commands/restart.js +89 -0
- package/cli/dist/commands/runtime.js +75 -0
- package/cli/dist/commands/stack.js +171 -0
- package/cli/dist/commands/stacks.js +71 -0
- package/cli/dist/commands/status.js +211 -0
- package/cli/dist/commands/ui.js +725 -0
- package/cli/dist/commands/up.js +609 -0
- package/cli/dist/commands/upgrade.js +840 -0
- package/cli/dist/commands/version.js +10 -0
- package/cli/dist/components/Accessible.js +11 -0
- package/cli/dist/components/BaseTooltip.js +30 -0
- package/cli/dist/components/DetailPanel.js +33 -0
- package/cli/dist/components/FileTree.js +51 -0
- package/cli/dist/components/ResourceSelectInput.js +42 -0
- package/cli/dist/components/ResourceTable.js +35 -0
- package/cli/dist/components/ServiceIssues.js +13 -0
- package/cli/dist/components/TUIHeader.js +27 -0
- package/cli/dist/components/TabBar.js +27 -0
- package/cli/dist/components/Tooltip.js +13 -0
- package/cli/dist/components/index.js +11 -0
- package/cli/dist/components/ui-theme.js +120 -0
- package/cli/dist/config/platform-standards.js +182 -0
- package/cli/dist/frontend-frameworks/lit.js +64 -0
- package/cli/dist/frontend-frameworks/preact.js +62 -0
- package/cli/dist/frontend-frameworks/qwik.js +61 -0
- package/cli/dist/frontend-frameworks/react.js +69 -0
- package/cli/dist/frontend-frameworks/registry.js +83 -0
- package/cli/dist/frontend-frameworks/solid.js +62 -0
- package/cli/dist/frontend-frameworks/svelte.js +67 -0
- package/cli/dist/frontend-frameworks/tanstack-router.js +101 -0
- package/cli/dist/frontend-frameworks/types.js +1 -0
- package/cli/dist/frontend-frameworks/vanilla.js +59 -0
- package/cli/dist/frontend-frameworks/vue.js +72 -0
- package/cli/dist/generator/__tests__/golden-helpers.js +43 -0
- package/cli/dist/generator/extension-fetch.js +291 -0
- package/cli/dist/generator/resource-templates.js +133 -0
- package/cli/dist/generator/template-engine.js +801 -0
- package/cli/dist/index.js +10 -0
- package/cli/dist/mcp/server.js +101 -0
- package/cli/dist/mcp/tools.js +351 -0
- package/cli/dist/program.js +37 -0
- package/cli/dist/types/index.js +38 -0
- package/cli/dist/utils/agent-host.js +36 -0
- package/cli/dist/utils/atomic-write.js +36 -0
- package/cli/dist/utils/bun-floor.js +9 -0
- package/cli/dist/utils/bun-requirement.js +10 -0
- package/cli/dist/utils/cache.js +63 -0
- package/cli/dist/utils/cold-preflight.js +257 -0
- package/cli/dist/utils/command-helpers.js +57 -0
- package/cli/dist/utils/constants.js +160 -0
- package/cli/dist/utils/discovery-context.js +71 -0
- package/cli/dist/utils/discovery-paths.js +93 -0
- package/cli/dist/utils/docker.js +34 -0
- package/cli/dist/utils/doctor-crashloop.js +161 -0
- package/cli/dist/utils/doctor-fix.js +391 -0
- package/cli/dist/utils/doctor-host.js +66 -0
- package/cli/dist/utils/doctor-report.js +78 -0
- package/cli/dist/utils/doctor-runtime.js +880 -0
- package/cli/dist/utils/doctor-starlark.js +132 -0
- package/cli/dist/utils/doctor-wiring.js +698 -0
- package/cli/dist/utils/down-cleanup.js +125 -0
- package/cli/dist/utils/env-validator.js +266 -0
- package/cli/dist/utils/errors.js +175 -0
- package/cli/dist/utils/exec-async.js +31 -0
- package/cli/dist/utils/file-helpers.js +104 -0
- package/cli/dist/utils/formatting.js +165 -0
- package/cli/dist/utils/generated-paths.js +51 -0
- package/cli/dist/utils/help-command.js +11 -0
- package/cli/dist/utils/host-port-config.js +140 -0
- package/cli/dist/utils/host-port-plan.js +100 -0
- package/cli/dist/utils/json-output.js +29 -0
- package/cli/dist/utils/machine-output.js +33 -0
- package/cli/dist/utils/paths.js +43 -0
- package/cli/dist/utils/platform.js +58 -0
- package/cli/dist/utils/port-assignment.js +75 -0
- package/cli/dist/utils/port-conflict-fix.js +25 -0
- package/cli/dist/utils/port-fallback-notice.js +17 -0
- package/cli/dist/utils/port-listener-probe.js +20 -0
- package/cli/dist/utils/project-config-defaults.js +17 -0
- package/cli/dist/utils/project-features.js +91 -0
- package/cli/dist/utils/project-templates.js +32 -0
- package/cli/dist/utils/prompt.js +97 -0
- package/cli/dist/utils/resource-features.js +184 -0
- package/cli/dist/utils/resource-kind.js +9 -0
- package/cli/dist/utils/schema-version-gate.js +45 -0
- package/cli/dist/utils/search-status.js +12 -0
- package/cli/dist/utils/secret-redaction.js +73 -0
- package/cli/dist/utils/service-config-checks.js +189 -0
- package/cli/dist/utils/service-manifest.js +254 -0
- package/cli/dist/utils/service-runtime-state.js +66 -0
- package/cli/dist/utils/service-urls.js +112 -0
- package/cli/dist/utils/services.js +360 -0
- package/cli/dist/utils/shared-infra.js +45 -0
- package/cli/dist/utils/shared-platform-postgres.js +232 -0
- package/cli/dist/utils/single-flight.js +21 -0
- package/cli/dist/utils/smoke.js +401 -0
- package/cli/dist/utils/spinner.js +40 -0
- package/cli/dist/utils/stack-features.js +15 -0
- package/cli/dist/utils/stack-status.js +14 -0
- package/cli/dist/utils/startup-report.js +78 -0
- package/cli/dist/utils/status-message.js +21 -0
- package/cli/dist/utils/status-ports.js +33 -0
- package/cli/dist/utils/suggestions.js +63 -0
- package/cli/dist/utils/tar.js +46 -0
- package/cli/dist/utils/tdk-version.js +51 -0
- package/cli/dist/utils/terminal-layout.js +19 -0
- package/cli/dist/utils/tilt-events.js +194 -0
- package/cli/dist/utils/tilt-logs.js +61 -0
- package/cli/dist/utils/tilt-port-owner.js +63 -0
- package/cli/dist/utils/tilt-process.js +54 -0
- package/cli/dist/utils/tilt-resource-state.js +32 -0
- package/cli/dist/utils/tilt-startup.js +49 -0
- package/cli/dist/utils/tilt-unreachable-message.js +9 -0
- package/cli/dist/utils/tilt.js +104 -0
- package/cli/dist/utils/ui-keymap.js +129 -0
- package/cli/dist/utils/ui-service-state.js +34 -0
- package/cli/dist/utils/up-only.js +28 -0
- package/cli/dist/utils/up-readiness.js +118 -0
- package/cli/dist/utils/url-actions.js +103 -0
- package/cli/dist/utils/validation.js +62 -0
- package/cli/dist/utils/which.js +56 -0
- package/cli/dist/utils/windows-doctor.js +176 -0
- package/cli/dist-bundle/chunk-6EA4DGCY.js +2 -0
- package/cli/dist-bundle/chunk-BZ4H7MM4.js +3 -0
- package/cli/dist-bundle/chunk-CLCUIDBH.js +510 -0
- package/cli/dist-bundle/cli.js +2017 -0
- package/cli/dist-bundle/cold-preflight-SY26O2IG.js +2 -0
- package/cli/dist-bundle/devtools-ZUHXW33W.js +5 -0
- package/cli/dist-bundle/extension-fetch-J4FFH7TJ.js +2 -0
- package/cli/package.json +83 -0
- package/cli/shared-platform-engineering/docker-templates/bun-hoisted-symlink-fix.sh +25 -0
- package/cli/shared-platform-engineering/docker-templates/infisical-entrypoint.sh +466 -0
- package/cli/shared-platform-engineering/docker-templates/install-deps.sh +154 -0
- package/cli/shared-platform-engineering/docker-templates/prisma-bun-client-link-fix.sh +14 -0
- package/cli/shared-platform-engineering/docker-templates/prisma-normalize-client.sh +58 -0
- package/cli/templates/.tiltignore.hbs +72 -0
- package/cli/templates/TILT_RESOURCE_DEFAULTS.star.hbs +220 -0
- package/cli/templates/TILT_TECH_STACK.star.hbs +149 -0
- package/cli/templates/Tiltfile.hbs +381 -0
- package/cli/templates/spec.master.hbs +192 -0
- package/discovery/AGENTS.md +362 -0
- package/discovery/TILT_DISCOVERY.star +429 -0
- package/discovery/Tiltfile +58 -0
- package/discovery/config.star +265 -0
- package/discovery/constants.star +167 -0
- package/discovery/deterministic.star +213 -0
- package/discovery/discovery_daemon.star +193 -0
- package/discovery/discovery_orchestrator.star +492 -0
- package/discovery/filtering.star +7 -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 +215 -0
- package/discovery/indexing.star +9 -0
- package/discovery/json_manifest_scanner.star +57 -0
- package/discovery/libraries.star +48 -0
- package/discovery/loading.star +25 -0
- package/discovery/manifest/constants.star +106 -0
- package/discovery/manifest/loading.star +418 -0
- package/discovery/manifest/normalize.star +289 -0
- package/discovery/manifest/validation.star +110 -0
- package/discovery/normalization.star +13 -0
- package/discovery/registry.star +562 -0
- package/discovery/resource_snapshot.py +384 -0
- package/discovery/resource_snapshot.star +145 -0
- package/discovery/schemas.star +3 -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 +253 -0
- package/discovery/validation.star +80 -0
- package/discovery/versioning.star +3 -0
- package/engine/AGENTS.md +706 -0
- package/engine/README.md +31 -0
- package/engine/REFACTORING_MANIFEST_SYSTEM.md +974 -0
- package/engine/Tiltfile +86 -0
- package/engine/assets/docker/golden-layers.Dockerfile +204 -0
- package/engine/assets/docker/wake-gateway/Dockerfile +28 -0
- package/engine/assets/docker/wake-gateway/decide.test.ts +177 -0
- package/engine/assets/docker/wake-gateway/decide.ts +135 -0
- package/engine/assets/docker/wake-gateway/server.ts +363 -0
- package/engine/assets/scripts/cleanup-completed-migrator-images.sh +39 -0
- package/engine/assets/scripts/cleanup-tilt-images.sh +122 -0
- package/engine/assets/scripts/mac-m1-resource-monitor.sh +123 -0
- package/engine/config.star +5 -0
- package/engine/entrypoint.star +101 -0
- package/engine/lifecycle/orchestrator.star +263 -0
- package/engine/paths.star +719 -0
- package/engine/schemas/project-schema.json +147 -0
- package/engine/schemas/service-schema.json +537 -0
- package/engine/scripts/README.md +89 -0
- package/engine/scripts/build-and-publish-lib.sh +207 -0
- package/engine/scripts/check-lib-publish.sh +87 -0
- package/engine/scripts/debug-container.sh +265 -0
- package/engine/scripts/generate-manifest.sh +200 -0
- package/engine/spec.master +702 -0
- package/engine/spec.master.example +341 -0
- package/engine/topologies/README.md +33 -0
- package/engine/topologies/platform/docker/AGENTS.md +59 -0
- package/engine/topologies/platform/docker/auth/auth.star +207 -0
- package/engine/topologies/platform/docker/build/frontend_build_plan.star +65 -0
- package/engine/topologies/platform/docker/build/golden_image.star +37 -0
- package/engine/topologies/platform/docker/build/golden_image_build.star +144 -0
- package/engine/topologies/platform/docker/build/golden_image_constants.star +100 -0
- package/engine/topologies/platform/docker/build/golden_image_dockerfile.star +263 -0
- package/engine/topologies/platform/docker/compose/compose.star +637 -0
- package/engine/topologies/platform/docker/compose/compose_helpers.star +54 -0
- package/engine/topologies/platform/docker/compose/traefik_standalone.star +171 -0
- package/engine/topologies/platform/docker/config/bunignore.star +144 -0
- package/engine/topologies/platform/docker/config/dockerignore.star +152 -0
- package/engine/topologies/platform/docker/config/healthcheck.star +58 -0
- package/engine/topologies/platform/docker/constants.star +211 -0
- package/engine/topologies/platform/docker/dockerfile/dockerfile.star +56 -0
- package/engine/topologies/platform/docker/dockerfile/language_dockerfile.star +264 -0
- package/engine/topologies/platform/docker/generators/golden_docker_generator_v2.star +76 -0
- package/engine/topologies/platform/docker/index.star +40 -0
- package/engine/topologies/platform/docker/layers/bun_helpers.star +25 -0
- package/engine/topologies/platform/docker/layers/infisical/index.star +42 -0
- package/engine/topologies/platform/docker/layers/infisical/infisical_docker.star +264 -0
- package/engine/topologies/platform/docker/layers/l1_base_layers.star +89 -0
- package/engine/topologies/platform/docker/layers/l2_dependency_layers.star +147 -0
- package/engine/topologies/platform/docker/layers/l3_builder_layers.star +229 -0
- package/engine/topologies/platform/docker/layers/l4_runtime_layers.star +282 -0
- package/engine/topologies/platform/docker/layers/prisma/constants.star +138 -0
- package/engine/topologies/platform/docker/layers/prisma/db_readiness.star +98 -0
- package/engine/topologies/platform/docker/layers/prisma/filesystem_setup.star +131 -0
- package/engine/topologies/platform/docker/layers/prisma/migrate_script.star +100 -0
- package/engine/topologies/platform/docker/layers/prisma/prisma_build.star +128 -0
- package/engine/topologies/platform/docker/layers/prisma/prisma_runtime.star +205 -0
- package/engine/topologies/platform/docker/layers/prisma/secret_resolution.star +121 -0
- package/engine/topologies/platform/docker/networking/api_path_constants.star +206 -0
- package/engine/topologies/platform/docker/networking/sablier_container_cycle.star +31 -0
- package/engine/topologies/platform/docker/networking/traefik.star +266 -0
- package/engine/topologies/platform/docker/networking/traefik_constants.star +148 -0
- package/engine/topologies/platform/docker/networking/traefik_helpers.star +162 -0
- package/engine/topologies/platform/docker/networking/traefik_static_routes.star +165 -0
- package/engine/topologies/platform/docker/secrets/env_secrets.star +74 -0
- package/engine/topologies/platform/docker/secrets/infisical.star +109 -0
- package/engine/topologies/platform/net/AGENTS.md +64 -0
- package/engine/topologies/platform/net/proxy.star +6 -0
- package/engine/topologies/platform/registries/local.star +6 -0
- package/engine/topologies/platform/registries/verdaccio_loader.star +20 -0
- package/engine/topologies/platform/security/AGENTS.md +49 -0
- package/engine/topologies/platform/security/secrets.star +241 -0
- package/engine/topologies/platform/state/AGENTS.md +64 -0
- package/engine/topologies/platform/state/relational.star +6 -0
- package/engine/topologies/tilt/common/AGENTS.md +59 -0
- package/engine/topologies/tilt/common/utils.star +409 -0
- package/engine/topologies/tilt/common/utils_debug.star +71 -0
- package/engine/topologies/tilt/common/utils_deterministic.star +170 -0
- package/engine/topologies/tilt/common/utils_docker_networks.star +54 -0
- package/engine/topologies/tilt/common/utils_env.star +92 -0
- package/engine/topologies/tilt/common/utils_output.star +99 -0
- package/engine/topologies/tilt/config/AGENTS.md +68 -0
- package/engine/topologies/tilt/config/defaults.star +5 -0
- package/engine/topologies/tilt/config/feature_flags.star +12 -0
- package/engine/topologies/tilt/config/global.star +57 -0
- package/engine/topologies/tilt/config/profiles.star +398 -0
- package/engine/topologies/tilt/generators/agents_md.star +64 -0
- package/engine/topologies/tilt/generators/api_gateway.star +147 -0
- package/engine/topologies/tilt/generators/index.star +126 -0
- package/engine/topologies/tilt/generators/infisical/README.md +424 -0
- package/engine/topologies/tilt/generators/infisical/examples.star +314 -0
- package/engine/topologies/tilt/generators/infisical/index.star +59 -0
- package/engine/topologies/tilt/generators/infisical/machine_identity.star +422 -0
- package/engine/topologies/tilt/generators/infisical/organization.star +536 -0
- package/engine/topologies/tilt/generators/infisical/path_manager.star +478 -0
- package/engine/topologies/tilt/generators/infisical/secrets_generator.star +422 -0
- package/engine/topologies/tilt/generators/nginx_conf.star +145 -0
- package/engine/topologies/tilt/generators/npmrc.star +132 -0
- package/engine/topologies/tilt/generators/tsconfig.star +25 -0
- package/engine/topologies/tilt/generators/typescript/backend_library_tsconfig.star +73 -0
- package/engine/topologies/tilt/generators/typescript/backend_tsconfig.star +137 -0
- package/engine/topologies/tilt/generators/typescript/common.star +9 -0
- package/engine/topologies/tilt/generators/typescript/frontend_library_tsconfig.star +78 -0
- package/engine/topologies/tilt/generators/typescript/frontend_tsconfig.star +140 -0
- package/engine/topologies/tilt/generators/typescript/include.star +25 -0
- package/engine/topologies/tilt/generators/typescript/playwright_config.star +42 -0
- package/engine/topologies/tilt/generators/typescript/prisma_config.star +51 -0
- package/engine/topologies/tilt/generators/validators.star +868 -0
- package/engine/topologies/tilt/generators/vite/backend.star +80 -0
- package/engine/topologies/tilt/generators/vite/frameworks/lit.star +92 -0
- package/engine/topologies/tilt/generators/vite/frameworks/preact.star +94 -0
- package/engine/topologies/tilt/generators/vite/frameworks/qwik.star +94 -0
- package/engine/topologies/tilt/generators/vite/frameworks/react.star +128 -0
- package/engine/topologies/tilt/generators/vite/frameworks/solid.star +94 -0
- package/engine/topologies/tilt/generators/vite/frameworks/svelte.star +94 -0
- package/engine/topologies/tilt/generators/vite/frameworks/vanilla.star +92 -0
- package/engine/topologies/tilt/generators/vite/frameworks/vue.star +94 -0
- package/engine/topologies/tilt/generators/vite/frontend.star +153 -0
- package/engine/topologies/tilt/generators/vite/generators.star +45 -0
- package/engine/topologies/tilt/generators/vite/helpers.star +256 -0
- package/engine/topologies/tilt/generators/vite/library.star +67 -0
- package/engine/topologies/tilt/generators/vite/sdk.star +75 -0
- package/engine/topologies/tilt/generators/vite/templates.star +460 -0
- package/engine/topologies/tilt/generators/vite_config.star +24 -0
- package/engine/topologies/tilt/manifest/AGENTS.md +61 -0
- package/engine/topologies/tilt/manifest/README.md +679 -0
- package/engine/topologies/tilt/manifest/__init__.star +220 -0
- package/engine/topologies/tilt/manifest/constants.star +262 -0
- package/engine/topologies/tilt/manifest/errors.star +268 -0
- package/engine/topologies/tilt/manifest/integration.star +348 -0
- package/engine/topologies/tilt/manifest/json_to_yaml.py +61 -0
- package/engine/topologies/tilt/manifest/loader.star +239 -0
- package/engine/topologies/tilt/manifest/mapper.star +229 -0
- package/engine/topologies/tilt/manifest/parser.star +490 -0
- package/engine/topologies/tilt/manifest/schema.star +502 -0
- package/engine/topologies/tilt/manifest/tests/test_integration.star +278 -0
- package/engine/topologies/tilt/manifest/tests/test_loader_parser.star +475 -0
- package/engine/topologies/tilt/manifest/tests/test_manifest.star +319 -0
- package/engine/topologies/tilt/manifest/tests/test_validator.star +472 -0
- package/engine/topologies/tilt/manifest/validator.star +744 -0
- package/engine/topologies/tilt/manifest/yaml_to_json.py +20 -0
- package/engine/topologies/tilt/resources/AGENTS.md +71 -0
- package/engine/topologies/tilt/resources/build_concurrency.star +56 -0
- package/engine/topologies/tilt/resources/conditions.star +5 -0
- package/engine/topologies/tilt/resources/databases.star +246 -0
- package/engine/topologies/tilt/resources/declaration.star +5 -0
- package/engine/topologies/tilt/resources/deps.star +5 -0
- package/engine/topologies/tilt/resources/infra-loader.star +504 -0
- package/engine/topologies/tilt/resources/libs.star +32 -0
- package/engine/topologies/tilt/resources/libs_discovery.star +104 -0
- package/engine/topologies/tilt/resources/libs_paths.star +81 -0
- package/engine/topologies/tilt/resources/libs_resource_definition.star +153 -0
- package/engine/topologies/tilt/resources/libs_setup.star +166 -0
- package/engine/topologies/tilt/resources/libs_tsconfig.star +39 -0
- package/engine/topologies/tilt/resources/orchestrator/apply.star +79 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star +864 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_manifest_orchestration.star +90 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_migrator_orchestration.star +150 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_resource_validation.star +38 -0
- package/engine/topologies/tilt/resources/orchestrator/apply_runtime_flags.star +46 -0
- package/engine/topologies/tilt/resources/orchestrator/builders/typescript.star +193 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/AGENTS.md +75 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/index.star +23 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/resolver.star +136 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/env.star +219 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/frontend.star +172 -0
- package/engine/topologies/tilt/resources/orchestrator/generators/manifest_resource.star +577 -0
- package/engine/topologies/tilt/resources/orchestrator/helpers.star +35 -0
- package/engine/topologies/tilt/resources/orchestrator.star +56 -0
- package/engine/topologies/tilt/resources/ordering.star +5 -0
- package/engine/topologies/tilt/resources/shared-platform-postgres.star +30 -0
- package/engine/topologies/tilt/resources/triggers.star +5 -0
- package/engine/topologies/tilt/resources/watchers.star +304 -0
- package/engine/where-things-live.star +719 -0
- package/examples/tdk-example/LICENSE +21 -0
- package/examples/tdk-example/README.md +23 -0
- package/examples/tdk-example/TILT_SERVICE_DEFAULTS.star +42 -0
- package/examples/tdk-example/TILT_TECH_STACK.star +67 -0
- package/examples/tdk-example/Tiltfile +25 -0
- package/examples/tdk-example/services/platform/messaging/docker-compose.yml +26 -0
- package/examples/tdk-example/services/shop/orders-api/package.json +20 -0
- package/examples/tdk-example/services/shop/orders-api/service.json +14 -0
- package/examples/tdk-example/services/shop/orders-api/src/index.ts +81 -0
- package/examples/tdk-example/services/shop/orders-app/index.html +12 -0
- package/examples/tdk-example/services/shop/orders-app/package.json +23 -0
- package/examples/tdk-example/services/shop/orders-app/public/.gitkeep +0 -0
- package/examples/tdk-example/services/shop/orders-app/service.json +9 -0
- package/examples/tdk-example/services/shop/orders-app/src/main.tsx +9 -0
- package/examples/tdk-example/services/shop/orders-app/src/orders.tsx +67 -0
- package/examples/tdk-example/services/shop/orders-app/src/style.css +15 -0
- package/examples/tdk-example/services/shop/orders-worker/package.json +18 -0
- package/examples/tdk-example/services/shop/orders-worker/service.json +13 -0
- package/examples/tdk-example/services/shop/orders-worker/src/index.ts +33 -0
- package/ext/Tiltfile +66 -0
- package/ext/ide-components/README.md +221 -0
- package/ext/ide-components/code_viewer/server.py +208 -0
- package/ext/ide-components/config_inspector/server.py +1052 -0
- package/ext/ide-components/file_browser/server.py +287 -0
- package/ext/ide-components/shared/config_service.py +471 -0
- package/ext/ide-components/shared/file_utils.py +300 -0
- package/ext/ide-components/shared/http_utils.py +234 -0
- package/ext/ide-components/shared/static/styles.css +1334 -0
- package/ext/ide-components/shared/syntax_highlighter.py +142 -0
- package/ext/ide-components/shared/template_engine.py +125 -0
- package/ext/ide-components/shared/templates/base.html +121 -0
- package/ext/ide-components/shared/test_config_service.py +328 -0
- package/ext/ide-components/shared/tilt_integration.py +160 -0
- package/ext/ui-enhancements/cron-status-server.sh +51 -0
- package/ext/ui-enhancements/cron-status-tracker.sh +148 -0
- package/ext/ui-enhancements/extension.yaml +36 -0
- package/ext/ui-enhancements/tiltfile.py +101 -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 +94 -4
- package/shared-platform-engineering/docker-templates/bun-hoisted-symlink-fix.sh +25 -0
- package/shared-platform-engineering/docker-templates/infisical-entrypoint.sh +466 -0
- package/shared-platform-engineering/docker-templates/install-deps.sh +154 -0
- package/shared-platform-engineering/docker-templates/prisma-bun-client-link-fix.sh +14 -0
- package/shared-platform-engineering/docker-templates/prisma-normalize-client.sh +58 -0
- package/specs/specs/TILT_SERVICE_DEFAULTS.star +207 -0
- package/specs/specs/TILT_TECH_STACK.star +161 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
/** Validates that a string is a safe HTTP or HTTPS URL before passing to system commands. */
|
|
5
|
+
export function isValidHttpUrl(candidate) {
|
|
6
|
+
try {
|
|
7
|
+
const parsed = new URL(candidate);
|
|
8
|
+
return parsed.protocol === "http:" || parsed.protocol === "https:";
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Opens a URL in the user's default browser across platforms.
|
|
16
|
+
* Uses `open` on macOS, `rundll32 url.dll,FileProtocolHandler` on Windows, and `xdg-open` on Linux.
|
|
17
|
+
*/
|
|
18
|
+
export function openUrl(url, platform = process.platform, spawnFn = spawn) {
|
|
19
|
+
if (!isValidHttpUrl(url)) {
|
|
20
|
+
return Promise.resolve(false);
|
|
21
|
+
}
|
|
22
|
+
let cmd;
|
|
23
|
+
let args;
|
|
24
|
+
if (platform === "darwin") {
|
|
25
|
+
cmd = "open";
|
|
26
|
+
args = [url];
|
|
27
|
+
}
|
|
28
|
+
else if (platform === "win32") {
|
|
29
|
+
// Avoid cmd.exe: it treats & | ^ < > in the URL as shell syntax.
|
|
30
|
+
cmd = "rundll32.exe";
|
|
31
|
+
args = ["url.dll,FileProtocolHandler", url];
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
cmd = "xdg-open";
|
|
35
|
+
args = [url];
|
|
36
|
+
}
|
|
37
|
+
return new Promise((resolve) => {
|
|
38
|
+
try {
|
|
39
|
+
const child = spawnFn(cmd, args, {
|
|
40
|
+
stdio: "ignore",
|
|
41
|
+
detached: true,
|
|
42
|
+
windowsHide: true,
|
|
43
|
+
});
|
|
44
|
+
child.once("error", () => resolve(false));
|
|
45
|
+
child.once("spawn", () => {
|
|
46
|
+
if (typeof child.unref === "function") {
|
|
47
|
+
child.unref();
|
|
48
|
+
}
|
|
49
|
+
resolve(true);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
resolve(false);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Copies text to the system clipboard across platforms.
|
|
59
|
+
* Uses `pbcopy` on macOS, `clip` on Windows, and `xclip` on Linux.
|
|
60
|
+
*/
|
|
61
|
+
export function copyToClipboard(text, platform = process.platform, spawnFn = spawn) {
|
|
62
|
+
return new Promise((resolve) => {
|
|
63
|
+
let cmd;
|
|
64
|
+
let args;
|
|
65
|
+
if (platform === "darwin") {
|
|
66
|
+
cmd = "pbcopy";
|
|
67
|
+
args = [];
|
|
68
|
+
}
|
|
69
|
+
else if (platform === "win32") {
|
|
70
|
+
cmd = "clip";
|
|
71
|
+
args = [];
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
cmd = "xclip";
|
|
75
|
+
args = ["-selection", "clipboard"];
|
|
76
|
+
}
|
|
77
|
+
try {
|
|
78
|
+
const child = spawnFn(cmd, args, {
|
|
79
|
+
stdio: ["pipe", "ignore", "ignore"],
|
|
80
|
+
windowsHide: true,
|
|
81
|
+
});
|
|
82
|
+
child.on("error", () => {
|
|
83
|
+
resolve(false);
|
|
84
|
+
});
|
|
85
|
+
child.on("close", (code) => {
|
|
86
|
+
resolve(code === 0);
|
|
87
|
+
});
|
|
88
|
+
if (child.stdin) {
|
|
89
|
+
child.stdin.on("error", () => {
|
|
90
|
+
resolve(false);
|
|
91
|
+
});
|
|
92
|
+
child.stdin.write(text, "utf-8");
|
|
93
|
+
child.stdin.end();
|
|
94
|
+
}
|
|
95
|
+
else {
|
|
96
|
+
resolve(false);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
resolve(false);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { OPTIONAL_INFRA_SERVICES } from "./constants.js";
|
|
2
|
+
export const KEBAB_CASE_REGEX = /^[a-z0-9-]+$/;
|
|
3
|
+
function isKebabCase(value) {
|
|
4
|
+
return KEBAB_CASE_REGEX.test(value);
|
|
5
|
+
}
|
|
6
|
+
const KEBAB_RULE = "Use lowercase letters, numbers, and hyphens only";
|
|
7
|
+
function invalidNameMessage(label, value) {
|
|
8
|
+
const example = label === "Resource name" ? "my-service" : "my-stack";
|
|
9
|
+
return `${label} "${value}" is not valid. ${KEBAB_RULE}, e.g. "${example}".`;
|
|
10
|
+
}
|
|
11
|
+
export function validateResourceName(name) {
|
|
12
|
+
if (!name.trim()) {
|
|
13
|
+
return { valid: false, error: "Resource name is required" };
|
|
14
|
+
}
|
|
15
|
+
if (!isKebabCase(name)) {
|
|
16
|
+
return { valid: false, error: invalidNameMessage("Resource name", name) };
|
|
17
|
+
}
|
|
18
|
+
return { valid: true };
|
|
19
|
+
}
|
|
20
|
+
export function validateStackName(name) {
|
|
21
|
+
if (!name.trim()) {
|
|
22
|
+
return { valid: false, error: "Stack name is required" };
|
|
23
|
+
}
|
|
24
|
+
if (!isKebabCase(name)) {
|
|
25
|
+
return { valid: false, error: invalidNameMessage("Stack name", name) };
|
|
26
|
+
}
|
|
27
|
+
return { valid: true };
|
|
28
|
+
}
|
|
29
|
+
export function createKebabCaseValidator(context) {
|
|
30
|
+
const validate = context === "resource" ? validateResourceName : validateStackName;
|
|
31
|
+
return (input) => {
|
|
32
|
+
const result = validate(input);
|
|
33
|
+
return result.valid ? true : (result.error ?? "Invalid name");
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export function validateOptionalInfraService(service) {
|
|
37
|
+
if (includes(OPTIONAL_INFRA_SERVICES, service)) {
|
|
38
|
+
return { valid: true };
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
valid: false,
|
|
42
|
+
error: `Invalid service. Must be one of: ${OPTIONAL_INFRA_SERVICES.join(", ")}`,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export function isValidPort(port) {
|
|
46
|
+
return Number.isInteger(port) && port > 0 && port <= 65535;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Check a filesystem path segment for characters that are unsafe to use in a
|
|
50
|
+
* path (null bytes, or characters that are invalid on common filesystems).
|
|
51
|
+
* Does not check for path traversal (`..`) - callers that resolve the path
|
|
52
|
+
* against a base directory should check that separately.
|
|
53
|
+
*/
|
|
54
|
+
export function isPathSafe(path) {
|
|
55
|
+
return !path.includes("\0") && !/[<>:"|?*]/.test(path);
|
|
56
|
+
}
|
|
57
|
+
export function sanitizeForShell(value, replacement = "_") {
|
|
58
|
+
return value.replace(/[^a-zA-Z0-9-]/g, replacement).substring(0, 100);
|
|
59
|
+
}
|
|
60
|
+
export function includes(array, value) {
|
|
61
|
+
return array.includes(value);
|
|
62
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { delimiter, extname, join } from "node:path";
|
|
5
|
+
import { isWindows, pathLookups } from "./platform.js";
|
|
6
|
+
export function findOnPath(command) {
|
|
7
|
+
const pathEnv = process.env.PATH ?? process.env.Path ?? "";
|
|
8
|
+
const windows = isWindows();
|
|
9
|
+
const names = pathLookups(command, windows);
|
|
10
|
+
if (windows && !extname(command)) {
|
|
11
|
+
for (const extension of (process.env.PATHEXT ?? ".EXE;.CMD;.BAT;.COM").split(";")) {
|
|
12
|
+
const suffix = extension.toLowerCase();
|
|
13
|
+
if (suffix && !names.includes(`${command}${suffix}`))
|
|
14
|
+
names.push(`${command}${suffix}`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
for (const dir of pathEnv.split(delimiter)) {
|
|
18
|
+
if (!dir)
|
|
19
|
+
continue;
|
|
20
|
+
for (const name of names) {
|
|
21
|
+
const candidate = join(dir, name);
|
|
22
|
+
if (existsSync(candidate))
|
|
23
|
+
return candidate;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
export function findAllOnPath(command) {
|
|
29
|
+
const pathEnv = process.env.PATH ?? process.env.Path ?? "";
|
|
30
|
+
const windows = isWindows();
|
|
31
|
+
const names = pathLookups(command, windows);
|
|
32
|
+
if (windows && !extname(command)) {
|
|
33
|
+
for (const extension of (process.env.PATHEXT ?? ".EXE;.CMD;.BAT;.COM").split(";")) {
|
|
34
|
+
const suffix = extension.toLowerCase();
|
|
35
|
+
if (suffix && !names.includes(`${command}${suffix}`))
|
|
36
|
+
names.push(`${command}${suffix}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const found = [];
|
|
40
|
+
const seen = new Set();
|
|
41
|
+
for (const dir of pathEnv.split(delimiter)) {
|
|
42
|
+
if (!dir)
|
|
43
|
+
continue;
|
|
44
|
+
for (const name of names) {
|
|
45
|
+
const candidate = join(dir, name);
|
|
46
|
+
if (!existsSync(candidate))
|
|
47
|
+
continue;
|
|
48
|
+
const key = windows ? candidate.toLowerCase() : candidate;
|
|
49
|
+
if (!seen.has(key)) {
|
|
50
|
+
seen.add(key);
|
|
51
|
+
found.push(candidate);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return found;
|
|
56
|
+
}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { execFileSync } from "node:child_process";
|
|
4
|
+
import { lookup } from "node:dns/promises";
|
|
5
|
+
import { parsePublishedPortHolders, probeHostPort } from "./doctor-runtime.js";
|
|
6
|
+
import { findProjectRoot } from "./paths.js";
|
|
7
|
+
import { getProjectName } from "./service-urls.js";
|
|
8
|
+
import { findOnPath } from "./which.js";
|
|
9
|
+
const WINDOWS_DNS_FAILURE = "Windows did not resolve *.tdk.localhost to 127.0.0.1. Browser URLs with hostnames will fail until you fix hosts or use the 127.0.0.1 URLs printed by flisk networks.";
|
|
10
|
+
function loopbackAddresses(addresses) {
|
|
11
|
+
return (addresses.length > 0 &&
|
|
12
|
+
addresses.every((address) => address === "127.0.0.1" || address === "::1"));
|
|
13
|
+
}
|
|
14
|
+
export function parseExcludedPortRanges(output) {
|
|
15
|
+
return output.split(/\r?\n/).flatMap((line) => {
|
|
16
|
+
const match = line.match(/^\s*(\d+)\s+(\d+)(?:\s|$)/);
|
|
17
|
+
return match ? [[Number(match[1]), Number(match[2])]] : [];
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export function findExternallyOccupiedPorts(occupied, dockerHolders, projectName) {
|
|
21
|
+
const prefix = projectName.replace(/-/g, "_").toLowerCase();
|
|
22
|
+
return occupied.filter((port) => {
|
|
23
|
+
const holder = dockerHolders.find((candidate) => candidate.publishedPorts.includes(port));
|
|
24
|
+
if (!holder || !prefix)
|
|
25
|
+
return true;
|
|
26
|
+
const name = holder.name.toLowerCase();
|
|
27
|
+
return !name.startsWith(`${prefix}_`) && !name.startsWith(`${prefix}-`);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function checkDockerTool() {
|
|
31
|
+
return findOnPath("docker");
|
|
32
|
+
}
|
|
33
|
+
export function checkWindowsRuntimeTools() {
|
|
34
|
+
const docker = checkDockerTool();
|
|
35
|
+
if (!docker) {
|
|
36
|
+
return {
|
|
37
|
+
name: "Windows Runtime Tools",
|
|
38
|
+
didPass: false,
|
|
39
|
+
message: "Docker is not running. Start Docker Desktop, wait until it is Running, then retry flisk doctor.",
|
|
40
|
+
fix: "Install Docker Desktop and start it in Linux container mode.",
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
if (!findOnPath("tilt")) {
|
|
44
|
+
return {
|
|
45
|
+
name: "Windows Runtime Tools",
|
|
46
|
+
didPass: false,
|
|
47
|
+
message: "tilt.exe not found on PATH. Install Tilt from https://docs.tilt.dev/install.html",
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const bun = findOnPath("bun");
|
|
51
|
+
const npmInstall = (process.argv[1] ?? "").toLowerCase().includes("node_modules");
|
|
52
|
+
const node = npmInstall ? findOnPath("node") : true;
|
|
53
|
+
if (!node) {
|
|
54
|
+
return {
|
|
55
|
+
name: "Windows Runtime Tools",
|
|
56
|
+
didPass: false,
|
|
57
|
+
message: "node.exe not found on PATH for this npm installation.",
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
name: "Windows Runtime Tools",
|
|
62
|
+
didPass: true,
|
|
63
|
+
message: bun
|
|
64
|
+
? `Docker (${docker}), Tilt, and Bun found on PATH`
|
|
65
|
+
: `Docker (${docker}) and Tilt found on PATH; ⚠️ Bun was not found (generated services need Bun)`,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
export function checkWindowsDockerMode() {
|
|
69
|
+
try {
|
|
70
|
+
const osType = execFileSync(findOnPath("docker") ?? "docker", ["info", "--format", "{{.OSType}}"], {
|
|
71
|
+
encoding: "utf-8",
|
|
72
|
+
timeout: 10_000,
|
|
73
|
+
windowsHide: true,
|
|
74
|
+
}).trim();
|
|
75
|
+
if (osType.toLowerCase() === "windows") {
|
|
76
|
+
return {
|
|
77
|
+
name: "Docker container mode",
|
|
78
|
+
didPass: false,
|
|
79
|
+
message: "Docker Desktop is using Windows containers. Switch to Linux containers. Flisk stacks are Linux images.",
|
|
80
|
+
fix: "Switch Docker Desktop to Linux containers. Flisk does not run Windows containers.",
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
name: "Docker container mode",
|
|
85
|
+
didPass: true,
|
|
86
|
+
message: "Docker Desktop is using Linux containers",
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
return {
|
|
91
|
+
name: "Docker container mode",
|
|
92
|
+
didPass: false,
|
|
93
|
+
message: "Docker is not running. Start Docker Desktop, wait until it is Running, then retry flisk doctor.",
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
export async function checkWindowsHostConfiguration() {
|
|
98
|
+
const warnings = [];
|
|
99
|
+
let excludedRanges = [];
|
|
100
|
+
try {
|
|
101
|
+
const output = execFileSync("netsh", ["interface", "ipv4", "show", "excludedportrange", "protocol=tcp"], { encoding: "utf-8", timeout: 10_000, windowsHide: true });
|
|
102
|
+
excludedRanges = parseExcludedPortRanges(output);
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
warnings.push("Could not inspect Windows Hyper-V excluded TCP port ranges.");
|
|
106
|
+
}
|
|
107
|
+
const requiredPorts = [80, 443, 5432];
|
|
108
|
+
const excluded = requiredPorts.filter((port) => excludedRanges.some(([start, end]) => port >= start && port <= end));
|
|
109
|
+
if (excluded.length > 0) {
|
|
110
|
+
warnings.push(`⚠️ Windows reserved port${excluded.length > 1 ? "s" : ""} ${excluded.join(", ")} for Hyper-V/WSL. Fix: disable the conflicting Windows feature or change Flisk ports in project config. Common fix: run \`net stop winnat\` then \`net start winnat\` in an Administrator terminal, then retry \`flisk doctor\`.`);
|
|
111
|
+
}
|
|
112
|
+
const occupied = [];
|
|
113
|
+
for (const port of requiredPorts) {
|
|
114
|
+
if ((await probeHostPort(port)) === "in-use")
|
|
115
|
+
occupied.push(port);
|
|
116
|
+
}
|
|
117
|
+
let dockerHolders = [];
|
|
118
|
+
try {
|
|
119
|
+
const dockerPs = execFileSync(findOnPath("docker") ?? "docker", ["ps", "--format", "{{.Names}}\\t{{.Ports}}"], { encoding: "utf-8", timeout: 10_000, windowsHide: true });
|
|
120
|
+
dockerHolders = parsePublishedPortHolders(dockerPs, requiredPorts);
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
// Runtime checks report Docker daemon errors independently.
|
|
124
|
+
}
|
|
125
|
+
const projectName = findProjectRoot() ? getProjectName() : "";
|
|
126
|
+
const externallyOccupied = findExternallyOccupiedPorts(occupied, dockerHolders, projectName);
|
|
127
|
+
if (externallyOccupied.length > 0) {
|
|
128
|
+
try {
|
|
129
|
+
const owners = execFileSync("powershell.exe", [
|
|
130
|
+
"-NoProfile",
|
|
131
|
+
"-Command",
|
|
132
|
+
`$ports = '${externallyOccupied.join(",")}'.Split(','); foreach ($port in $ports) { Get-NetTCPConnection -LocalPort ([int]$port) -State Listen -ErrorAction SilentlyContinue | ForEach-Object { $connection = $_; $service = Get-CimInstance Win32_Service | Where-Object { $_.ProcessId -eq $connection.OwningProcess } | Select-Object -First 1; if ([int]$port -eq 80 -and ($service.Name -eq 'W3SVC' -or $connection.OwningProcess -eq 4)) { '80: IIS / World Wide Web Publishing (HTTP.sys)' } elseif ($service) { '{0}: {1}' -f $port, $service.DisplayName } else { '{0}: PID {1}' -f $port, $connection.OwningProcess } } }`,
|
|
133
|
+
], { encoding: "utf-8", timeout: 10_000, windowsHide: true }).trim();
|
|
134
|
+
warnings.push(`⚠️ Ports ${externallyOccupied.join(", ")} are already listening${owners ? `:\n${owners}` : "."}`);
|
|
135
|
+
}
|
|
136
|
+
catch {
|
|
137
|
+
warnings.push(`⚠️ Ports ${externallyOccupied.join(", ")} are already in use.`);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
let dnsOk = true;
|
|
141
|
+
for (const host of ["tdk.localhost", "example.tdk.localhost"]) {
|
|
142
|
+
try {
|
|
143
|
+
const records = await lookup(host, { all: true, verbatim: true });
|
|
144
|
+
if (!loopbackAddresses(records.map((record) => record.address)))
|
|
145
|
+
dnsOk = false;
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
dnsOk = false;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (!dnsOk) {
|
|
152
|
+
warnings.push(`${WINDOWS_DNS_FAILURE}\nAdd these lines to C:\\Windows\\System32\\drivers\\etc\\hosts (Administrator Notepad):\n127.0.0.1 tdk.localhost\n127.0.0.1 example.tdk.localhost`);
|
|
153
|
+
}
|
|
154
|
+
try {
|
|
155
|
+
const autocrlf = execFileSync("git", ["config", "core.autocrlf"], {
|
|
156
|
+
encoding: "utf-8",
|
|
157
|
+
timeout: 5_000,
|
|
158
|
+
windowsHide: true,
|
|
159
|
+
}).trim();
|
|
160
|
+
if (autocrlf.toLowerCase() === "true") {
|
|
161
|
+
warnings.push("git core.autocrlf is true; generated files may get CRLF while Docker Linux containers expect LF. Recommended: git config core.autocrlf input in Flisk repos.");
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
// No repository-local setting to report.
|
|
166
|
+
}
|
|
167
|
+
warnings.push("Docker Desktop Settings → Resources → File sharing must include this project directory.");
|
|
168
|
+
return {
|
|
169
|
+
name: "Windows ports and DNS",
|
|
170
|
+
didPass: dnsOk && externallyOccupied.length === 0,
|
|
171
|
+
message: warnings.length > 0
|
|
172
|
+
? warnings.join("\n")
|
|
173
|
+
: "Required ports are available and Flisk localhost DNS resolves to loopback",
|
|
174
|
+
...(dnsOk ? {} : { fix: WINDOWS_DNS_FAILURE }),
|
|
175
|
+
};
|
|
176
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
+
var g=Object.create;var e=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var i=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var m=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(b,c)=>(typeof require<"u"?require:b)[c]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var n=(a,b)=>()=>{try{return b||a((b={exports:{}}).exports,b),b.exports}catch(c){throw b=0,c}},o=(a,b)=>{for(var c in b)e(a,c,{get:b[c],enumerable:!0})},l=(a,b,c,f)=>{if(b&&typeof b=="object"||typeof b=="function")for(let d of i(b))!k.call(a,d)&&d!==c&&e(a,d,{get:()=>b[d],enumerable:!(f=h(b,d))||f.enumerable});return a};var p=(a,b,c)=>(c=a!=null?g(j(a)):{},l(b||!a||!a.__esModule?e(c,"default",{value:a,enumerable:!0}):c,a));export{m as a,n as b,o as c,p as d};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{createRequire as __tdkRequire}from'node:module';const require=__tdkRequire(import.meta.url);
|
|
2
|
+
import{randomUUID as M}from"node:crypto";import{existsSync as p,mkdirSync as g,readFileSync as y,statSync as U,writeFileSync as h}from"node:fs";import{homedir as S}from"node:os";import{join as a}from"node:path";import{spawnSync as _}from"node:child_process";import{existsSync as E,mkdirSync as w,mkdtempSync as N,readdirSync as $,renameSync as C,rmSync as v,statSync as j,writeFileSync as O}from"node:fs";import{tmpdir as L}from"node:os";import{join as c}from"node:path";function k(e,n){let r=N(c(L(),"flisk-ext-")),o=c(r,"bundle.tar.gz");O(o,e),w(n,{recursive:!0});let t=process.platform==="win32"?"tar.exe":"tar",i=_(t,["xzf",o,"-C",n,"--strip-components=1"],{stdio:"pipe",windowsHide:!0});if(i.status!==0){let s=c(r,"fallback");w(s,{recursive:!0});let m=_(t,["xzf",o,"-C",s],{stdio:"pipe",windowsHide:!0});if(m.status!==0)throw v(r,{recursive:!0,force:!0}),new Error(`tar extraction failed: ${m.stderr?.toString()||i.stderr?.toString()||"unknown error"}`);let l=$(s),[u]=l,f=l.length===1&&u!==void 0&&E(c(s,u))&&j(c(s,u)).isDirectory()?c(s,u):s;for(let d of $(f))C(c(f,d),c(n,d))}v(r,{recursive:!0,force:!0})}var A="https://tdk-extension-dist.oranguman.workers.dev/v1/premium/bundle.tar.gz",z=["playwright","c4-diagram","logging","agents-md","sablier","verdaccio"],R=720*60*1e3,P={"typescript/playwright_config.star":"engine/topologies/tilt/generators/typescript/playwright_config.star","generators/agents_md.star":"engine/topologies/tilt/generators/agents_md.star","c4_diagram.star":"engine/topologies/tilt/generators/c4_diagram.star","observability/logging.star":"engine/topologies/platform/observability/logging.star","generators/database_provisioner.star":"engine/topologies/tilt/generators/database_provisioner.star","generators/dependency_manifest.star":"engine/topologies/tilt/generators/dependency_manifest.star","generators/fixed_frontend_tsconfig.star":"engine/topologies/tilt/generators/typescript/fixed_frontend_tsconfig.star","synthetic_monitor.star":"engine/resources/synthetic_monitor.star","synthetic-monitor-topology.star":"engine/topologies/platform/services/synthetic-monitor.star","database-management-service.yaml":"platform/services/platform/database-management/service.yaml","networking/sablier_container_cycle.star":"engine/topologies/platform/docker/networking/sablier_container_cycle.star","registries/verdaccio_loader.star":"engine/topologies/platform/registries/verdaccio_loader.star"};function x(){return process.env.TDK_LICENSE_KEY?.trim()||null}function B(){return process.env.TDK_PREMIUM_ENDPOINT?.trim()||A}function I(e){let n=a(e,".tdk",".project-id");if(p(n))return y(n,"utf-8").trim();let r=M();return g(a(e,".tdk"),{recursive:!0}),h(n,`${r}
|
|
3
|
+
`),r}function F(e){let n=e.replace(/[^a-zA-Z0-9_-]/g,"_");return a(S(),".tdk","cache",`premium-${n}`,"premium.tar.gz")}function T(e){return p(e)?Date.now()-U(e).mtimeMs<R:!1}async function D(e,n,r){let o=`${B()}?resource=${encodeURIComponent(n)}&projectId=${encodeURIComponent(r)}`,t=await fetch(o,{headers:{Authorization:`Bearer ${e}`}});return t.status!==401?t:(await t.arrayBuffer().catch(()=>{}),fetch(`${o}&key=${encodeURIComponent(e)}`))}async function H(e,n){let r=[];for(let o of z){let t;try{t=await D(e,o,n)}catch(i){return console.warn(`\u26A0\uFE0F Premium fetch failed (network error): ${i.message}`),null}if(t.ok){let i=Buffer.from(await t.arrayBuffer());return console.info(`\u{1F50E} Premium entitlement probe: granted resource=${o} (HTTP ${t.status}); prior denials=${r.join(", ")||"none"}`),console.info(`\u{1F50E} Premium bundle download: ${i.byteLength} bytes`),i}if(t.status===401||t.status===403){r.push(`${o}=${t.status}`);continue}return console.warn(`\u26A0\uFE0F Premium fetch failed: ${o} returned HTTP ${t.status}; prior entitlement probes: ${r.join(", ")||"none"}`),null}return console.warn(`\u26A0\uFE0F Premium entitlement probes denied: ${r.join(", ")}`),null}async function re(e,n){let r=x();if(!r)return!1;let o=F(r);if(T(o))console.info("\u{1F50E} Premium bundle cache: hit (cached bundle reused)");else{console.info("\u{1F50E} Premium bundle cache: miss; requesting bundle from distribution service");let t=I(e),i=await H(r,t);if(!i)return console.warn("\u26A0\uFE0F No premium resources unlocked for this key - using free tier only."),!1;g(a(o,".."),{recursive:!0}),h(o,i)}try{let t=a(o,"..","extracted");g(t,{recursive:!0}),k(y(o),t);let i=0,s=[];for(let[l,u]of Object.entries(P)){let f=a(t,l);if(!p(f)){s.push(l);continue}let d=a(n,u);g(a(d,".."),{recursive:!0}),h(d,y(f)),i++}let m=a(t,"networking/sablier_container_cycle.star");if(console.info(`\u{1F50E} Premium bundle contents: mapped=${i}/${Object.keys(P).length}; sablier_overlay=${p(m)?"present":"MISSING"}`),s.length>0&&console.info(`\u{1F50E} Premium bundle missing mapped files: ${s.join(", ")}`),!p(m)&&process.env.TDK_PREMIUM_DIAGNOSTICS==="1"){let l=await G(e);console.info(`\u{1F50E} Sablier entitlement check: ${l?"granted":"not confirmed"}; compare with sablier_overlay above to distinguish license access from bundle contents`)}return i>0?(console.log(`\u2713 Premium resources unlocked (${i} file${i===1?"":"s"})`),!0):!1}catch(t){return console.warn(`\u26A0\uFE0F Failed to apply premium overlay: ${t.message}`),!1}}function K(e,n){let r=e.replace(/[^a-zA-Z0-9_-]/g,"_");return a(S(),".tdk","cache",`premium-${r}`,`${n}-access.json`)}async function b(e,n){let r=x();if(!r)return!1;let o=K(r,n);if(T(o))try{let s=JSON.parse(y(o,"utf-8"));return console.info(`\u{1F50E} ${n} entitlement probe: cache=${s.granted===!0?"granted":"denied"}`),s.granted===!0}catch{}let t=I(e),i=!1;try{let s=await D(r,n,t);i=s.ok,console.info(`\u{1F50E} ${n} entitlement probe: HTTP ${s.status} (${i?"granted":"denied"})`),s.body&&await s.arrayBuffer().catch(()=>{})}catch(s){return console.warn(`\u26A0\uFE0F ${n} license check failed (network error): ${s.message}`),!1}try{g(a(o,".."),{recursive:!0}),h(o,JSON.stringify({granted:i,checked:new Date().toISOString()}))}catch{}return i}async function ne(e){return b(e,"verdaccio")}async function oe(e){return b(e,"ddd")}async function G(e){return b(e,"sablier")}export{k as a,re as b,ne as c,oe as d,G as e};
|