@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,63 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { execFileSync } from "node:child_process";
|
|
4
|
+
import { realpathSync } from "node:fs";
|
|
5
|
+
import { resolve } from "node:path";
|
|
6
|
+
import { parseTiltProcesses } from "./doctor-wiring.js";
|
|
7
|
+
const run = (command, args) => execFileSync(command, args, {
|
|
8
|
+
encoding: "utf-8",
|
|
9
|
+
stdio: "pipe",
|
|
10
|
+
timeout: 5000,
|
|
11
|
+
windowsHide: true,
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* The project whose `tilt up` listens on `port`, or null when it cannot be told (no lsof, Windows, a Tilt started
|
|
15
|
+
* without `-f`, a listener that is not Tilt). Callers must treat null as "unknown", not as "not mine".
|
|
16
|
+
*/
|
|
17
|
+
export function findTiltPortOwner(port, platform = process.platform, commandRunner = run) {
|
|
18
|
+
if (platform === "win32")
|
|
19
|
+
return null;
|
|
20
|
+
try {
|
|
21
|
+
const pids = commandRunner("lsof", ["-nP", `-iTCP:${port}`, "-sTCP:LISTEN", "-t"])
|
|
22
|
+
.split(/\r?\n/)
|
|
23
|
+
.map((line) => line.trim())
|
|
24
|
+
.filter(Boolean);
|
|
25
|
+
for (const pid of pids) {
|
|
26
|
+
const command = commandRunner("ps", ["-p", pid, "-o", "command="]).trim();
|
|
27
|
+
const [owner] = parseTiltProcesses(`${pid} ${command}`);
|
|
28
|
+
if (owner)
|
|
29
|
+
return owner;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
// lsof exits 1 when nothing listens, and may be missing.
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
/** Symlinked checkouts (macOS /tmp -> /private/tmp) must not make a project look foreign to itself. */
|
|
38
|
+
function canonical(path) {
|
|
39
|
+
try {
|
|
40
|
+
return realpathSync(path);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return resolve(path);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
/** Whether `owner` is another project's Tilt, as opposed to this project's or unknown. */
|
|
47
|
+
export function isForeignTilt(owner, projectRoot) {
|
|
48
|
+
return owner !== null && canonical(owner.root) !== canonical(projectRoot);
|
|
49
|
+
}
|
|
50
|
+
/** Split the candidate Tilt UI ports that answer into this project's and other projects'. */
|
|
51
|
+
export async function classifyTiltPorts(candidatePorts, projectRoot, isServing, ownerOf = findTiltPortOwner) {
|
|
52
|
+
const result = { running: [], foreign: [] };
|
|
53
|
+
for (const port of candidatePorts) {
|
|
54
|
+
if (!(await isServing(port)))
|
|
55
|
+
continue;
|
|
56
|
+
const owner = ownerOf(port);
|
|
57
|
+
if (owner && isForeignTilt(owner, projectRoot))
|
|
58
|
+
result.foreign.push({ port, root: owner.root });
|
|
59
|
+
else
|
|
60
|
+
result.running.push(port);
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { execFileSync } from "node:child_process";
|
|
4
|
+
const run = (command, args) => execFileSync(command, args, { encoding: "utf-8", stdio: "pipe", windowsHide: true });
|
|
5
|
+
/** Refuse to target arbitrary listeners: only stop a Tilt process on the requested UI port. */
|
|
6
|
+
export function findTiltProcessIdsOnPort(port, platform = process.platform, commandRunner = run) {
|
|
7
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535)
|
|
8
|
+
return [];
|
|
9
|
+
if (platform === "win32") {
|
|
10
|
+
const script = `$port=${port}; Get-NetTCPConnection -LocalPort $port -State Listen -ErrorAction SilentlyContinue | ForEach-Object { $p=Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue; if ($p -and $p.ProcessName -eq 'tilt') { $_.OwningProcess } } | Sort-Object -Unique`;
|
|
11
|
+
try {
|
|
12
|
+
return commandRunner("powershell.exe", ["-NoProfile", "-Command", script])
|
|
13
|
+
.split(/\s+/)
|
|
14
|
+
.map(Number)
|
|
15
|
+
.filter((pid) => Number.isInteger(pid) && pid > 0);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
throw new Error(`Unable to inspect Tilt listeners on port ${port} with PowerShell.`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
let pids;
|
|
22
|
+
try {
|
|
23
|
+
pids = commandRunner("lsof", ["-nP", "-t", `-iTCP:${port}`, "-sTCP:LISTEN"])
|
|
24
|
+
.split(/\s+/)
|
|
25
|
+
.map(Number)
|
|
26
|
+
.filter((pid) => Number.isInteger(pid) && pid > 0);
|
|
27
|
+
}
|
|
28
|
+
catch (err) {
|
|
29
|
+
const commandErr = err;
|
|
30
|
+
const stderr = commandErr.stderr?.toString().trim();
|
|
31
|
+
if (commandErr?.status === 1 && !stderr)
|
|
32
|
+
return [];
|
|
33
|
+
throw new Error(`Unable to inspect listeners on port ${port}. Install lsof or resolve the lsof error before using --force.`, { cause: commandErr });
|
|
34
|
+
}
|
|
35
|
+
return pids.filter((pid) => {
|
|
36
|
+
try {
|
|
37
|
+
const name = commandRunner("ps", ["-p", String(pid), "-o", "comm="]).trim();
|
|
38
|
+
return name.split(/[\\/]/).at(-1) === "tilt";
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
throw new Error(`Unable to identify the process listening on port ${port}.`, { cause: err });
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
export function stopTiltOnPort(port, platform = process.platform, commandRunner = run) {
|
|
46
|
+
const pids = findTiltProcessIdsOnPort(port, platform, commandRunner);
|
|
47
|
+
for (const pid of pids) {
|
|
48
|
+
if (platform === "win32")
|
|
49
|
+
commandRunner("taskkill.exe", ["/PID", String(pid), "/F"]);
|
|
50
|
+
else
|
|
51
|
+
commandRunner("kill", ["-TERM", String(pid)]);
|
|
52
|
+
}
|
|
53
|
+
return pids;
|
|
54
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
/**
|
|
4
|
+
* A Tilt resource that is not built and running yet: still waiting (`pending`, `none`) or building right now
|
|
5
|
+
* (`in_progress`). Readiness must treat all of these as not ready.
|
|
6
|
+
*/
|
|
7
|
+
export function isTiltResourcePending(updateStatus, runtimeStatus) {
|
|
8
|
+
return (updateStatus === "pending" ||
|
|
9
|
+
updateStatus === "in_progress" ||
|
|
10
|
+
updateStatus === "none" ||
|
|
11
|
+
runtimeStatus === "pending" ||
|
|
12
|
+
runtimeStatus === "none");
|
|
13
|
+
}
|
|
14
|
+
/** What a Tilt failure says when the container runs but Docker reports its health check as failing. */
|
|
15
|
+
export const UNHEALTHY_CONTAINER_MESSAGE = "container is running, but its health check is failing";
|
|
16
|
+
/**
|
|
17
|
+
* Tilt's runtime status, corrected for Docker health. Tilt reports a running compose container as `ok` even while its
|
|
18
|
+
* health check is still `starting` or has turned `unhealthy` (Tilt 0.37), so a Postgres that never accepts connections
|
|
19
|
+
* would read as ready. Health `starting` is pending and `unhealthy` is an error; a container without a health check
|
|
20
|
+
* keeps Tilt's status.
|
|
21
|
+
*/
|
|
22
|
+
export function effectiveRuntimeStatus(status) {
|
|
23
|
+
const runtimeStatus = status?.runtimeStatus ?? "";
|
|
24
|
+
if (runtimeStatus !== "ok")
|
|
25
|
+
return runtimeStatus;
|
|
26
|
+
const health = status?.composeResourceInfo?.healthStatus;
|
|
27
|
+
if (health === "unhealthy")
|
|
28
|
+
return "error";
|
|
29
|
+
if (health === "starting")
|
|
30
|
+
return "pending";
|
|
31
|
+
return runtimeStatus;
|
|
32
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { STANDARD_PORTS } from "./constants.js";
|
|
4
|
+
import { isValidPort } from "./validation.js";
|
|
5
|
+
export function parseTiltPort(value) {
|
|
6
|
+
if (value === undefined || value === "")
|
|
7
|
+
return { ok: true, port: undefined };
|
|
8
|
+
const port = Number(value);
|
|
9
|
+
if (/[^0-9]/.test(value) || !isValidPort(port)) {
|
|
10
|
+
return {
|
|
11
|
+
ok: false,
|
|
12
|
+
message: `Invalid TILT_PORT "${value}": expected an integer from 1 to 65535.`,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
return { ok: true, port };
|
|
16
|
+
}
|
|
17
|
+
/** Resolve the port for read-only polling, falling back when TILT_PORT is absent or invalid. */
|
|
18
|
+
export function getTiltPollingPort(value) {
|
|
19
|
+
const result = parseTiltPort(value);
|
|
20
|
+
return result.ok ? (result.port ?? STANDARD_PORTS.tiltUi) : STANDARD_PORTS.tiltUi;
|
|
21
|
+
}
|
|
22
|
+
export function secondUpAction(input) {
|
|
23
|
+
if (input.runningPorts.length === 0 || input.force)
|
|
24
|
+
return { action: "start" };
|
|
25
|
+
if (input.only)
|
|
26
|
+
return { action: "only-blocked", ports: input.runningPorts };
|
|
27
|
+
return { action: "already-running", ports: input.runningPorts };
|
|
28
|
+
}
|
|
29
|
+
export async function resolveTiltPort(options) {
|
|
30
|
+
if (options.configuredPort !== undefined) {
|
|
31
|
+
return { port: options.configuredPort, autoSwitched: false };
|
|
32
|
+
}
|
|
33
|
+
if (options.force)
|
|
34
|
+
return { port: options.basePort, autoSwitched: false };
|
|
35
|
+
const availablePort = await options.findAvailablePort(options.basePort, 10);
|
|
36
|
+
if (availablePort && availablePort !== options.basePort) {
|
|
37
|
+
return { port: availablePort, autoSwitched: true };
|
|
38
|
+
}
|
|
39
|
+
return { port: options.basePort, autoSwitched: false };
|
|
40
|
+
}
|
|
41
|
+
export async function stopTiltForUp(options, dependencies) {
|
|
42
|
+
if (!options.force)
|
|
43
|
+
return;
|
|
44
|
+
if (!options.quiet) {
|
|
45
|
+
dependencies.log(`Force flag set - stopping Tilt on port ${options.port} if running...`);
|
|
46
|
+
}
|
|
47
|
+
dependencies.stop(options.port);
|
|
48
|
+
await dependencies.wait(2000);
|
|
49
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
/**
|
|
4
|
+
* What `flisk logs` says when no Tilt answers on the port. The usual cause is that the stack is not up, so the message
|
|
5
|
+
* names the command that starts it; Tilt's own connection error is not repeated, because it only restates that.
|
|
6
|
+
*/
|
|
7
|
+
export function tiltUnreachableMessage(port) {
|
|
8
|
+
return `Could not reach Tilt on port ${port}. The stack is not running, or Tilt is on another port. Start it with: flisk up`;
|
|
9
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import { errorFactories } from "./errors.js";
|
|
6
|
+
import { findProjectRoot } from "./paths.js";
|
|
7
|
+
import { findOnPath } from "./which.js";
|
|
8
|
+
export function runTilt(command, args = [], options = {}) {
|
|
9
|
+
return new Promise((resolve, reject) => {
|
|
10
|
+
const tiltArgs = [command, ...args];
|
|
11
|
+
if (options.verbose) {
|
|
12
|
+
console.log(`Executing: tilt ${tiltArgs.join(" ")}`);
|
|
13
|
+
}
|
|
14
|
+
const child = spawn(findOnPath("tilt") ?? "tilt", tiltArgs, {
|
|
15
|
+
stdio: options.inheritStdio ? "inherit" : "pipe",
|
|
16
|
+
shell: false,
|
|
17
|
+
windowsHide: process.platform === "win32",
|
|
18
|
+
timeout: options.timeoutMs,
|
|
19
|
+
});
|
|
20
|
+
let stdout = "";
|
|
21
|
+
let stderr = "";
|
|
22
|
+
if (!options.inheritStdio) {
|
|
23
|
+
child.stdout?.on("data", (data) => {
|
|
24
|
+
stdout += data.toString();
|
|
25
|
+
});
|
|
26
|
+
child.stderr?.on("data", (data) => {
|
|
27
|
+
stderr += data.toString();
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
child.on("close", (code) => {
|
|
31
|
+
resolve({
|
|
32
|
+
exitCode: code ?? 1,
|
|
33
|
+
stdout,
|
|
34
|
+
stderr,
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
child.on("error", (err) => {
|
|
38
|
+
reject(new Error(`Failed to spawn tilt: ${err.message}`));
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export async function isTiltAvailable() {
|
|
43
|
+
try {
|
|
44
|
+
const result = await runTilt("version", [], { inheritStdio: false, timeoutMs: 10_000 });
|
|
45
|
+
return result.exitCode === 0;
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
// tilt binary not found (or not spawnable) - treat as unavailable
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export function getTiltfilePath() {
|
|
53
|
+
const projectRoot = findProjectRoot();
|
|
54
|
+
if (!projectRoot) {
|
|
55
|
+
throw errorFactories.notInProject();
|
|
56
|
+
}
|
|
57
|
+
return join(projectRoot, ".tdk", ".tdk-out", "Tiltfile");
|
|
58
|
+
}
|
|
59
|
+
function addTiltfilePath(args) {
|
|
60
|
+
const tiltfilePath = getTiltfilePath();
|
|
61
|
+
args.push("-f", tiltfilePath);
|
|
62
|
+
}
|
|
63
|
+
export function buildTiltUpArgs(serviceNames, options = {}) {
|
|
64
|
+
const args = [];
|
|
65
|
+
addTiltfilePath(args);
|
|
66
|
+
// Bare positional resource names only scope what this `tilt up` invocation waits
|
|
67
|
+
// on - they do NOT limit which resources the generated Tiltfile enables. Its focus
|
|
68
|
+
// filter (Config.apply_focus / apply_focus_filter) only reads the `--focus` flag;
|
|
69
|
+
// the positional-args catch-all it also defines (`cfg['args']`) is never read. So
|
|
70
|
+
// without `--focus`, every `flisk up <stack>` silently fell back to Tilt's default
|
|
71
|
+
// "pre-alpha" phase and built every stack in that phase, not just the one asked
|
|
72
|
+
// for. Passing the stack name via `--focus` reuses the Tiltfile's own (already
|
|
73
|
+
// dependency-aware) domain expansion instead of re-deriving it here.
|
|
74
|
+
//
|
|
75
|
+
// `--focus=...` needs a `--` before it: Tilt's own `tilt up` only accepts its own
|
|
76
|
+
// fixed flag set directly (see `tilt up --help`) and rejects anything else with
|
|
77
|
+
// "unknown flag" - `--` is what routes a token through to the Tiltfile's own
|
|
78
|
+
// config.parse(). Bare words like a service name aren't flag-shaped, so they don't
|
|
79
|
+
// need `--` to reach the Tiltfile's positional `args` catch-all.
|
|
80
|
+
if (options.focusTargets && options.focusTargets.length > 0) {
|
|
81
|
+
args.push("--", `--focus=${options.focusTargets.join(",")}`);
|
|
82
|
+
}
|
|
83
|
+
args.push(...serviceNames);
|
|
84
|
+
if (options.verbose && !options.quiet) {
|
|
85
|
+
args.push("--verbose");
|
|
86
|
+
}
|
|
87
|
+
if (options.watch) {
|
|
88
|
+
args.push("--watch");
|
|
89
|
+
}
|
|
90
|
+
return args;
|
|
91
|
+
}
|
|
92
|
+
export function buildTiltDownArgs(options = {}) {
|
|
93
|
+
const args = [];
|
|
94
|
+
addTiltfilePath(args);
|
|
95
|
+
// Note: `tilt down` has no `--force` or `--yes` flags. `flisk down` accepts them for
|
|
96
|
+
// CLI flag convention and script compatibility, but they must not be passed to Tilt.
|
|
97
|
+
// `tilt down` re-evaluates the Tiltfile and removes only the resources that evaluation registers. Without `--focus`
|
|
98
|
+
// the Tiltfile falls back to its default phase and never registers a stack's own compose project, so `flisk up shop`
|
|
99
|
+
// containers survived `flisk down`. Pass the same selection `flisk up` used (every stack) after `--`.
|
|
100
|
+
if (options.focusTargets && options.focusTargets.length > 0) {
|
|
101
|
+
args.push("--", `--focus=${options.focusTargets.join(",")}`);
|
|
102
|
+
}
|
|
103
|
+
return args;
|
|
104
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
export const TABS = [
|
|
2
|
+
{ id: "overview", label: "OVERVIEW", shortcut: "1" },
|
|
3
|
+
{ id: "resources", label: "RESOURCES", shortcut: "2" },
|
|
4
|
+
{ id: "events", label: "EVENTS", shortcut: "3" },
|
|
5
|
+
{ id: "files", label: "FILES", shortcut: "4" },
|
|
6
|
+
{ id: "config", label: "CONFIG", shortcut: "5" },
|
|
7
|
+
];
|
|
8
|
+
const tabRange = `${TABS.at(0)?.shortcut}-${TABS.at(-1)?.shortcut}`;
|
|
9
|
+
const uiKeymap = [
|
|
10
|
+
{
|
|
11
|
+
id: "list-navigation",
|
|
12
|
+
keys: ["ArrowUp", "ArrowDown", "j", "k"],
|
|
13
|
+
label: "Navigate list items",
|
|
14
|
+
group: "Navigation",
|
|
15
|
+
display: { ascii: "UP/DOWN or k/j", unicode: "↑/↓ or k/j" },
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: "first-last",
|
|
19
|
+
keys: ["g", "G", "Home", "End"],
|
|
20
|
+
label: "First/last item",
|
|
21
|
+
group: "Navigation",
|
|
22
|
+
display: { ascii: "g/G or Home/End", unicode: "g/G or Home/End" },
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: "page-list",
|
|
26
|
+
keys: ["PageUp", "PageDown"],
|
|
27
|
+
label: "Move one page",
|
|
28
|
+
group: "Navigation",
|
|
29
|
+
display: { ascii: "PgUp/PgDn", unicode: "PgUp/PgDn" },
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
id: "select",
|
|
33
|
+
keys: ["Enter", "Space"],
|
|
34
|
+
label: "Select item / Open detail",
|
|
35
|
+
group: "Navigation",
|
|
36
|
+
display: { ascii: "Enter or Space", unicode: "Enter or Space" },
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "cycle-tabs",
|
|
40
|
+
keys: ["Tab", "Shift+Tab"],
|
|
41
|
+
label: "Next / previous tab",
|
|
42
|
+
group: "Navigation",
|
|
43
|
+
display: { ascii: "Tab/Shift+Tab", unicode: "Tab/Shift+Tab" },
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: "direct-tabs",
|
|
47
|
+
keys: TABS.map((tab) => tab.shortcut),
|
|
48
|
+
label: "Direct tab access",
|
|
49
|
+
group: "Navigation",
|
|
50
|
+
display: { ascii: tabRange, unicode: tabRange },
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
id: "toggle-mouse",
|
|
54
|
+
keys: ["m"],
|
|
55
|
+
label: "Toggle mouse support",
|
|
56
|
+
group: "Actions",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
id: "toggle-tooltips",
|
|
60
|
+
keys: ["t"],
|
|
61
|
+
label: "Toggle tooltips",
|
|
62
|
+
group: "Actions",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "toggle-enabled",
|
|
66
|
+
keys: ["e"],
|
|
67
|
+
label: "Toggle enabled/disabled services",
|
|
68
|
+
group: "Actions",
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: "refresh",
|
|
72
|
+
keys: ["r"],
|
|
73
|
+
label: "Refresh data",
|
|
74
|
+
group: "Actions",
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: "open-url",
|
|
78
|
+
keys: ["o"],
|
|
79
|
+
label: "Open resource URL in browser",
|
|
80
|
+
group: "Actions",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: "copy-url",
|
|
84
|
+
keys: ["y"],
|
|
85
|
+
label: "Copy resource URL to clipboard",
|
|
86
|
+
group: "Actions",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: "search",
|
|
90
|
+
keys: ["/"],
|
|
91
|
+
label: "Search/filter",
|
|
92
|
+
group: "Actions",
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: "help",
|
|
96
|
+
keys: ["?"],
|
|
97
|
+
label: "Show this help",
|
|
98
|
+
group: "Actions",
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: "quit",
|
|
102
|
+
keys: ["q"],
|
|
103
|
+
label: "Quit",
|
|
104
|
+
group: "Actions",
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
id: "back",
|
|
108
|
+
keys: ["Esc"],
|
|
109
|
+
label: "Back",
|
|
110
|
+
group: "Actions",
|
|
111
|
+
},
|
|
112
|
+
];
|
|
113
|
+
export const UI_KEYMAP = uiKeymap;
|
|
114
|
+
function getUiKeymapEntry(id) {
|
|
115
|
+
const entry = UI_KEYMAP.find((shortcut) => shortcut.id === id);
|
|
116
|
+
if (!entry) {
|
|
117
|
+
throw new Error(`Unknown Flisk UI shortcut: ${id}`);
|
|
118
|
+
}
|
|
119
|
+
return entry;
|
|
120
|
+
}
|
|
121
|
+
export function formatUiKeyNames(id, ascii = false) {
|
|
122
|
+
const entry = getUiKeymapEntry(id);
|
|
123
|
+
const display = ascii ? entry.display?.ascii : entry.display?.unicode;
|
|
124
|
+
return display ?? entry.keys.join("/");
|
|
125
|
+
}
|
|
126
|
+
export function formatUiKeyHint(id, label, ascii = false) {
|
|
127
|
+
const entry = getUiKeymapEntry(id);
|
|
128
|
+
return `[${formatUiKeyNames(id, ascii)}] ${label ?? entry.label}`;
|
|
129
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { getDeferredResourceNames } from "./doctor-runtime.js";
|
|
2
|
+
import { deriveServiceStates } from "./service-runtime-state.js";
|
|
3
|
+
import { deriveStackStatus } from "./stack-status.js";
|
|
4
|
+
import { tiltGetUiResources } from "./up-readiness.js";
|
|
5
|
+
/** One look at the running Tilt. Empty when no Tilt answers, so every service stays unknown. */
|
|
6
|
+
export async function fetchServiceStates(services, tiltPort) {
|
|
7
|
+
try {
|
|
8
|
+
const text = await tiltGetUiResources(tiltPort);
|
|
9
|
+
if (!text)
|
|
10
|
+
return {};
|
|
11
|
+
return deriveServiceStates(text, Object.fromEntries(services.map((r) => [r.name, r.config?.dependsOn ?? []])), getDeferredResourceNames());
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/** The same states `flisk status` shows, put onto the stack the UI is about to draw. */
|
|
18
|
+
export function applyServiceStates(metadata, states) {
|
|
19
|
+
const resources = metadata.resources.map((resource) => {
|
|
20
|
+
const state = states[resource.name];
|
|
21
|
+
if (!state)
|
|
22
|
+
return resource;
|
|
23
|
+
return {
|
|
24
|
+
...resource,
|
|
25
|
+
status: state.status,
|
|
26
|
+
...(state.reason ? { statusReason: state.reason } : {}),
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
return {
|
|
30
|
+
...metadata,
|
|
31
|
+
resources,
|
|
32
|
+
overallStatus: deriveStackStatus(resources.map((r) => r.status)),
|
|
33
|
+
};
|
|
34
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Requested names that match no discovered service (the Tiltfile silently enables everything for an unknown focus name). */
|
|
2
|
+
export function findUnknownServices(requested, candidates) {
|
|
3
|
+
const known = new Set(candidates.map((resource) => resource.name));
|
|
4
|
+
return requested.filter((name) => !known.has(name));
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The requested services plus their `dependsOn` closure. This mirrors what the generated Tiltfile enables for
|
|
8
|
+
* `--focus=<service>` (see get_all_needed_services in engine/topologies/tilt/config/profiles.star) so the CLI can report
|
|
9
|
+
* the same set. Shared infrastructure (Postgres, Traefik, the golden images) is always enabled by the Tiltfile and is not listed here.
|
|
10
|
+
* A dependsOn entry that is not a discovered service is ignored.
|
|
11
|
+
*/
|
|
12
|
+
export function resolveOnlySelection(requested, all) {
|
|
13
|
+
const byName = new Map(all.map((resource) => [resource.name, resource]));
|
|
14
|
+
const wanted = new Set();
|
|
15
|
+
const visit = (name) => {
|
|
16
|
+
if (wanted.has(name) || !byName.has(name))
|
|
17
|
+
return;
|
|
18
|
+
wanted.add(name);
|
|
19
|
+
for (const dep of byName.get(name)?.config?.dependsOn ?? [])
|
|
20
|
+
visit(dep);
|
|
21
|
+
};
|
|
22
|
+
for (const name of requested)
|
|
23
|
+
visit(name);
|
|
24
|
+
return {
|
|
25
|
+
selected: all.filter((resource) => wanted.has(resource.name)),
|
|
26
|
+
dependencies: all.map((r) => r.name).filter((n) => wanted.has(n) && !requested.includes(n)),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { execFile } from "node:child_process";
|
|
4
|
+
import { getDeferredResourceNames, parseTiltResourceFailures } from "./doctor-runtime.js";
|
|
5
|
+
import { findOnPath } from "./which.js";
|
|
6
|
+
export function tiltGetUiResources(port) {
|
|
7
|
+
return new Promise((resolve) => {
|
|
8
|
+
execFile(findOnPath("tilt") ?? "tilt", ["get", "uiresources", "-o", "json", "--port", String(port)], { timeout: 15_000, maxBuffer: 16 * 1024 * 1024 }, (error, stdout) => resolve(error ? null : stdout));
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Tilt lists resources outside the current focus (the other release phases, or everything but a `--only` selection) with
|
|
13
|
+
* `disableStatus.state: Disabled` and both statuses `none`, which would read as pending forever. A resource whose update
|
|
14
|
+
* status is `not_applicable` (a serve-only local resource) has nothing to build, so it counts as built.
|
|
15
|
+
*/
|
|
16
|
+
export function onlyEnabledResources(jsonText) {
|
|
17
|
+
const parsed = JSON.parse(jsonText);
|
|
18
|
+
const items = (parsed.items ?? [])
|
|
19
|
+
.filter((item) => item.status?.disableStatus?.state !== "Disabled")
|
|
20
|
+
.map((item) => item.status?.updateStatus === "not_applicable"
|
|
21
|
+
? { ...item, status: { ...item.status, updateStatus: "ok" } }
|
|
22
|
+
: item);
|
|
23
|
+
return JSON.stringify({ items });
|
|
24
|
+
}
|
|
25
|
+
function enabledNames(jsonText) {
|
|
26
|
+
return (JSON.parse(jsonText).items ?? [])
|
|
27
|
+
.filter((item) => item.status?.disableStatus?.state !== "Disabled")
|
|
28
|
+
.flatMap((item) => (item.metadata?.name ? [item.metadata.name] : []));
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Services the caller asked for must not vanish into the disabled filter: one that Tilt lists as disabled (it can be
|
|
32
|
+
* disabled while running) is a failure, and one Tilt does not list yet is still pending.
|
|
33
|
+
*/
|
|
34
|
+
export function checkExpectedResources(jsonText, expected) {
|
|
35
|
+
const items = JSON.parse(jsonText).items ?? [];
|
|
36
|
+
const byName = new Map(items.map((item) => [item.metadata?.name, item]));
|
|
37
|
+
return {
|
|
38
|
+
missing: expected.filter((name) => !byName.has(name)),
|
|
39
|
+
disabled: expected.filter((name) => byName.get(name)?.status?.disableStatus?.state === "Disabled"),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* One look at `tilt get uiresources -o json`. `settled` means polling can stop: everything is ready, or the rest has
|
|
44
|
+
* finished with a failure (an errored resource, or an expected service Tilt has disabled).
|
|
45
|
+
*/
|
|
46
|
+
export function evaluateTiltReadiness(jsonText, deferred, expected) {
|
|
47
|
+
const parsed = parseTiltResourceFailures(onlyEnabledResources(jsonText), deferred);
|
|
48
|
+
let result = {
|
|
49
|
+
ready: parsed.failures.length === 0 && parsed.pendingCount === 0 && parsed.okCount > 0,
|
|
50
|
+
failures: parsed.failures.map((failure) => ({
|
|
51
|
+
name: failure.name,
|
|
52
|
+
message: failure.error || `${failure.updateStatus}/${failure.runtimeStatus}`,
|
|
53
|
+
})),
|
|
54
|
+
pending: parsed.pendingCount,
|
|
55
|
+
timedOut: false,
|
|
56
|
+
enabled: enabledNames(jsonText),
|
|
57
|
+
};
|
|
58
|
+
if (expected && expected.length > 0) {
|
|
59
|
+
const { missing, disabled } = checkExpectedResources(jsonText, expected);
|
|
60
|
+
if (missing.length > 0) {
|
|
61
|
+
result = { ...result, ready: false, pending: result.pending + missing.length };
|
|
62
|
+
}
|
|
63
|
+
if (disabled.length > 0) {
|
|
64
|
+
return {
|
|
65
|
+
settled: true,
|
|
66
|
+
result: {
|
|
67
|
+
...result,
|
|
68
|
+
ready: false,
|
|
69
|
+
failures: [
|
|
70
|
+
...result.failures,
|
|
71
|
+
...disabled.map((name) => ({ name, message: "disabled in Tilt" })),
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
result,
|
|
79
|
+
settled: result.ready || (result.failures.length > 0 && result.pending === 0),
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Waits until every non-deferred Tilt resource is built and running. Resolves not-ready as soon as the rest has settled
|
|
84
|
+
* with an errored resource, or at the deadline. Sablier-deferred resources are excluded: they stay idle by design.
|
|
85
|
+
*/
|
|
86
|
+
export async function waitForTiltResourcesReady(port, options = {}) {
|
|
87
|
+
const timeoutMs = options.timeoutMs ?? Number(process.env.TDK_UP_READY_TIMEOUT_MS ?? 900_000);
|
|
88
|
+
const intervalMs = options.intervalMs ?? 2_000;
|
|
89
|
+
const fetchJson = options.fetchJson ?? tiltGetUiResources;
|
|
90
|
+
const deferred = options.deferred ?? getDeferredResourceNames();
|
|
91
|
+
const deadline = Date.now() + timeoutMs;
|
|
92
|
+
let last = {
|
|
93
|
+
ready: false,
|
|
94
|
+
failures: [],
|
|
95
|
+
pending: 0,
|
|
96
|
+
timedOut: false,
|
|
97
|
+
enabled: [],
|
|
98
|
+
};
|
|
99
|
+
for (;;) {
|
|
100
|
+
const text = await fetchJson(port);
|
|
101
|
+
if (text) {
|
|
102
|
+
try {
|
|
103
|
+
const evaluation = evaluateTiltReadiness(text, deferred, options.expected);
|
|
104
|
+
last = evaluation.result;
|
|
105
|
+
if (evaluation.settled)
|
|
106
|
+
return last;
|
|
107
|
+
if (last.failures.length > 0 && options.isStalled?.(text))
|
|
108
|
+
return last;
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
/* Tilt may emit partial output while starting; retry. */
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (Date.now() >= deadline)
|
|
115
|
+
return { ...last, ready: false, timedOut: true };
|
|
116
|
+
await new Promise((resolve) => setTimeout(resolve, intervalMs));
|
|
117
|
+
}
|
|
118
|
+
}
|