@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,10 @@
|
|
|
1
|
+
export { CREATABLE_RESOURCE_TYPES, isCreatableResourceType, } from "./types/index.js";
|
|
2
|
+
export { Cache, createCacheValidator, } from "./utils/cache.js";
|
|
3
|
+
export { assertValid, confirmAction, confirmOrCancel, handleDryRun, } from "./utils/command-helpers.js";
|
|
4
|
+
// Re-export discovery-context functions for resources-by-stack operations
|
|
5
|
+
export { createDiscoveryContext } from "./utils/discovery-context.js";
|
|
6
|
+
export { writeFilesWithProgress } from "./utils/file-helpers.js";
|
|
7
|
+
export { findProjectRoot } from "./utils/paths.js";
|
|
8
|
+
export { checkPortStatus, findAvailablePort, } from "./utils/port-assignment.js";
|
|
9
|
+
export { clearMetadataCache, discoverResources, discoverStacks, getAllStacks, getResourceMetadata, getResourcesForStack, getStackMetadata, stackExists, } from "./utils/services.js";
|
|
10
|
+
export { buildTiltDownArgs, buildTiltUpArgs, getTiltfilePath, isTiltAvailable, runTilt, } from "./utils/tilt.js";
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
/**
|
|
4
|
+
* A minimal Model Context Protocol server over newline-delimited JSON-RPC 2.0 (the stdio transport). It implements only
|
|
5
|
+
* what a tools-only server needs: initialize, ping, tools/list and tools/call. Keeping it dependency-free keeps the
|
|
6
|
+
* published CLI small; the protocol surface used here is stable across the listed protocol versions.
|
|
7
|
+
*/
|
|
8
|
+
export const SUPPORTED_PROTOCOL_VERSIONS = ["2025-06-18", "2025-03-26", "2024-11-05"];
|
|
9
|
+
const ERROR = {
|
|
10
|
+
parse: -32700,
|
|
11
|
+
invalidRequest: -32600,
|
|
12
|
+
methodNotFound: -32601,
|
|
13
|
+
invalidParams: -32602,
|
|
14
|
+
};
|
|
15
|
+
function reply(id, result) {
|
|
16
|
+
return JSON.stringify({ jsonrpc: "2.0", id, result });
|
|
17
|
+
}
|
|
18
|
+
function fail(id, code, message) {
|
|
19
|
+
return JSON.stringify({ jsonrpc: "2.0", id: id ?? null, error: { code, message } });
|
|
20
|
+
}
|
|
21
|
+
export function createMcpServer(tools, info) {
|
|
22
|
+
const byName = new Map(tools.map((tool) => [tool.name, tool]));
|
|
23
|
+
async function handle(message) {
|
|
24
|
+
const isNotification = message.id === undefined;
|
|
25
|
+
if (message.jsonrpc !== "2.0" || typeof message.method !== "string") {
|
|
26
|
+
return isNotification ? null : fail(message.id, ERROR.invalidRequest, "Invalid request");
|
|
27
|
+
}
|
|
28
|
+
switch (message.method) {
|
|
29
|
+
case "initialize": {
|
|
30
|
+
const requested = String(message.params?.protocolVersion ?? "");
|
|
31
|
+
const protocolVersion = SUPPORTED_PROTOCOL_VERSIONS.includes(requested)
|
|
32
|
+
? requested
|
|
33
|
+
: SUPPORTED_PROTOCOL_VERSIONS[0];
|
|
34
|
+
return reply(message.id, {
|
|
35
|
+
protocolVersion,
|
|
36
|
+
capabilities: { tools: { listChanged: false } },
|
|
37
|
+
serverInfo: info,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
case "ping":
|
|
41
|
+
return reply(message.id, {});
|
|
42
|
+
case "tools/list":
|
|
43
|
+
return reply(message.id, {
|
|
44
|
+
tools: tools.map(({ name, description, inputSchema }) => ({
|
|
45
|
+
name,
|
|
46
|
+
description,
|
|
47
|
+
inputSchema,
|
|
48
|
+
})),
|
|
49
|
+
});
|
|
50
|
+
case "tools/call": {
|
|
51
|
+
const name = message.params?.name;
|
|
52
|
+
const tool = typeof name === "string" ? byName.get(name) : undefined;
|
|
53
|
+
if (!tool)
|
|
54
|
+
return fail(message.id, ERROR.invalidParams, `Unknown tool: ${String(name)}`);
|
|
55
|
+
const args = message.params?.arguments;
|
|
56
|
+
if (args !== undefined &&
|
|
57
|
+
(typeof args !== "object" || args === null || Array.isArray(args))) {
|
|
58
|
+
return fail(message.id, ERROR.invalidParams, "arguments must be an object");
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
const result = await tool.handler((args ?? {}));
|
|
62
|
+
return reply(message.id, {
|
|
63
|
+
content: [{ type: "text", text: JSON.stringify(result.data) }],
|
|
64
|
+
structuredContent: result.data,
|
|
65
|
+
isError: result.isError,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
// A tool failure is a tool result, not a protocol error, so the model can read and react to it.
|
|
70
|
+
const text = error instanceof Error ? error.message : String(error);
|
|
71
|
+
return reply(message.id, {
|
|
72
|
+
content: [{ type: "text", text }],
|
|
73
|
+
isError: true,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
default:
|
|
78
|
+
// Notifications such as notifications/initialized need no reply; unknown requests do.
|
|
79
|
+
return isNotification
|
|
80
|
+
? null
|
|
81
|
+
: fail(message.id, ERROR.methodNotFound, `Method not found: ${message.method}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
async handleLine(line) {
|
|
86
|
+
if (!line.trim())
|
|
87
|
+
return null;
|
|
88
|
+
let parsed;
|
|
89
|
+
try {
|
|
90
|
+
parsed = JSON.parse(line);
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
return fail(null, ERROR.parse, "Parse error");
|
|
94
|
+
}
|
|
95
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
96
|
+
return fail(null, ERROR.invalidRequest, "Invalid request");
|
|
97
|
+
}
|
|
98
|
+
return handle(parsed);
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { spawn } from "node:child_process";
|
|
4
|
+
import { closeSync, existsSync, openSync, readFileSync } from "node:fs";
|
|
5
|
+
import { tmpdir } from "node:os";
|
|
6
|
+
import { isAbsolute, join } from "node:path";
|
|
7
|
+
import { createMachineEnvelope } from "../utils/machine-output.js";
|
|
8
|
+
/** A service or stack name. A leading "-" is rejected so a value can never be read as a flag. */
|
|
9
|
+
const NAME = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
10
|
+
const SINCE = /^(\d+(\.\d+)?(ns|us|µs|ms|s|m|h))+$/;
|
|
11
|
+
/**
|
|
12
|
+
* How to run this CLI again: `node <script>` / `bun <script>` when started from a script, or the executable alone when it is
|
|
13
|
+
* a `bun build --compile` binary, whose argv[1] is a virtual path that exists only inside the binary.
|
|
14
|
+
*/
|
|
15
|
+
export function cliInvocation(execPath = process.execPath, script = process.argv[1], fileExists = existsSync) {
|
|
16
|
+
if (!script || script.startsWith("/$bunfs/") || script.includes("~BUN") || !fileExists(script)) {
|
|
17
|
+
return [execPath];
|
|
18
|
+
}
|
|
19
|
+
return [execPath, script];
|
|
20
|
+
}
|
|
21
|
+
/** Runs this same CLI (`flisk <args>`) so every tool behaves exactly like its command. */
|
|
22
|
+
export const runTdkCli = (args, options = {}) => new Promise((resolve, reject) => {
|
|
23
|
+
const [command, ...prefix] = cliInvocation();
|
|
24
|
+
const child = spawn(command, [...prefix, ...args], {
|
|
25
|
+
cwd: options.cwd,
|
|
26
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
27
|
+
env: { ...process.env, NO_COLOR: "1" },
|
|
28
|
+
});
|
|
29
|
+
let stdout = "";
|
|
30
|
+
let stderr = "";
|
|
31
|
+
child.stdout?.on("data", (chunk) => {
|
|
32
|
+
stdout += chunk.toString();
|
|
33
|
+
});
|
|
34
|
+
child.stderr?.on("data", (chunk) => {
|
|
35
|
+
stderr += chunk.toString();
|
|
36
|
+
});
|
|
37
|
+
const timer = setTimeout(() => child.kill("SIGTERM"), options.timeoutMs ?? 120_000);
|
|
38
|
+
child.once("error", (error) => {
|
|
39
|
+
clearTimeout(timer);
|
|
40
|
+
reject(error);
|
|
41
|
+
});
|
|
42
|
+
child.once("close", (exitCode) => {
|
|
43
|
+
clearTimeout(timer);
|
|
44
|
+
resolve({ exitCode, stdout, stderr });
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
function names(value, field) {
|
|
48
|
+
if (value === undefined)
|
|
49
|
+
return [];
|
|
50
|
+
if (!Array.isArray(value) || value.some((item) => typeof item !== "string" || !NAME.test(item))) {
|
|
51
|
+
throw new Error(`${field} must be an array of service names (letters, digits, ".", "_", "-")`);
|
|
52
|
+
}
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
function optionalName(value, field) {
|
|
56
|
+
if (value === undefined)
|
|
57
|
+
return undefined;
|
|
58
|
+
if (typeof value !== "string" || !NAME.test(value)) {
|
|
59
|
+
throw new Error(`${field} must be a name (letters, digits, ".", "_", "-")`);
|
|
60
|
+
}
|
|
61
|
+
return value;
|
|
62
|
+
}
|
|
63
|
+
function flag(value, field) {
|
|
64
|
+
if (value === undefined)
|
|
65
|
+
return false;
|
|
66
|
+
if (typeof value !== "boolean")
|
|
67
|
+
throw new Error(`${field} must be a boolean`);
|
|
68
|
+
return value;
|
|
69
|
+
}
|
|
70
|
+
/** Turn a command's `--json` stdout into a tool result. A parseable envelope with errors, or `ok: false`, is an error result. */
|
|
71
|
+
export function toToolResult(run) {
|
|
72
|
+
const text = run.stdout.trim();
|
|
73
|
+
// The envelope is the last JSON line; anything before it is incidental output.
|
|
74
|
+
const lastLine = text
|
|
75
|
+
.split("\n")
|
|
76
|
+
.filter((line) => line.trim().startsWith("{"))
|
|
77
|
+
.pop();
|
|
78
|
+
if (!lastLine) {
|
|
79
|
+
return {
|
|
80
|
+
data: {
|
|
81
|
+
errors: [
|
|
82
|
+
{
|
|
83
|
+
code: "NO_JSON",
|
|
84
|
+
message: run.stderr.trim() || `flisk exited with code ${run.exitCode}`,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
isError: true,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
const envelope = JSON.parse(lastLine);
|
|
93
|
+
const failed = (envelope.errors?.length ?? 0) > 0 || envelope.data?.ok === false;
|
|
94
|
+
return { data: envelope, isError: failed };
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
return {
|
|
98
|
+
data: { errors: [{ code: "BAD_JSON", message: lastLine.slice(0, 200) }] },
|
|
99
|
+
isError: true,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
export const defaultUpDeps = {
|
|
104
|
+
spawnUp(args, logFile, cwd) {
|
|
105
|
+
const fd = openSync(logFile, "a");
|
|
106
|
+
const [command, ...prefix] = cliInvocation();
|
|
107
|
+
const child = spawn(command, [...prefix, ...args], {
|
|
108
|
+
cwd,
|
|
109
|
+
detached: true,
|
|
110
|
+
stdio: ["ignore", fd, fd],
|
|
111
|
+
env: { ...process.env, NO_COLOR: "1" },
|
|
112
|
+
});
|
|
113
|
+
closeSync(fd);
|
|
114
|
+
return child;
|
|
115
|
+
},
|
|
116
|
+
readLog(logFile) {
|
|
117
|
+
try {
|
|
118
|
+
return readFileSync(logFile, "utf-8");
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return "";
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
|
|
125
|
+
now: () => Date.now(),
|
|
126
|
+
logFile: () => join(tmpdir(), `flisk-mcp-up-${Date.now()}.log`),
|
|
127
|
+
};
|
|
128
|
+
export function buildUpArgs(args) {
|
|
129
|
+
const stack = optionalName(args.stack, "stack");
|
|
130
|
+
const only = names(args.only, "only");
|
|
131
|
+
const out = ["up"];
|
|
132
|
+
if (stack)
|
|
133
|
+
out.push(stack);
|
|
134
|
+
if (only.length > 0)
|
|
135
|
+
out.push(...only.map((name) => `--only=${name}`));
|
|
136
|
+
if (flag(args.force, "force"))
|
|
137
|
+
out.push("--force");
|
|
138
|
+
if (flag(args.dryRun, "dryRun"))
|
|
139
|
+
out.push("--dry-run");
|
|
140
|
+
out.push("--json");
|
|
141
|
+
return out;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Starts the stack detached and returns without waiting for it to be ready (a build can take minutes, longer than a tool
|
|
145
|
+
* call may last). It watches only for an early result, which is how a refusal such as UNKNOWN_SERVICE, TILT_ALREADY_RUNNING
|
|
146
|
+
* or an unsupported host arrives; otherwise the caller polls the `status` tool for `data.tilt.readiness`.
|
|
147
|
+
*/
|
|
148
|
+
export async function startUp(args, deps = defaultUpDeps) {
|
|
149
|
+
const argv = buildUpArgs(args);
|
|
150
|
+
const logFile = deps.logFile();
|
|
151
|
+
const child = deps.spawnUp(argv, logFile, projectPath(args.projectPath));
|
|
152
|
+
let exited;
|
|
153
|
+
child.once("exit", (code) => {
|
|
154
|
+
exited = code;
|
|
155
|
+
});
|
|
156
|
+
const waitMs = typeof args.waitSeconds === "number"
|
|
157
|
+
? Math.min(Math.max(args.waitSeconds, 0), 60) * 1000
|
|
158
|
+
: 15_000;
|
|
159
|
+
const deadline = deps.now() + waitMs;
|
|
160
|
+
for (;;) {
|
|
161
|
+
const log = deps.readLog(logFile);
|
|
162
|
+
const line = log
|
|
163
|
+
.split("\n")
|
|
164
|
+
.filter((l) => l.startsWith('{"schemaVersion"'))
|
|
165
|
+
.pop();
|
|
166
|
+
if (line)
|
|
167
|
+
return { ...toToolResult({ exitCode: exited ?? null, stdout: line, stderr: "" }) };
|
|
168
|
+
if (exited !== undefined) {
|
|
169
|
+
return toToolResult({ exitCode: exited, stdout: "", stderr: log.slice(-2000) });
|
|
170
|
+
}
|
|
171
|
+
if (deps.now() >= deadline)
|
|
172
|
+
break;
|
|
173
|
+
await deps.sleep(250);
|
|
174
|
+
}
|
|
175
|
+
child.unref();
|
|
176
|
+
return {
|
|
177
|
+
data: createMachineEnvelope({
|
|
178
|
+
ok: true,
|
|
179
|
+
started: true,
|
|
180
|
+
pid: child.pid ?? null,
|
|
181
|
+
logFile,
|
|
182
|
+
next: "Poll the status tool until data.tilt.readiness.ready is true. Call down to stop it.",
|
|
183
|
+
}),
|
|
184
|
+
isError: false,
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
export function buildLogsArgs(args) {
|
|
188
|
+
const out = ["logs", "--json"];
|
|
189
|
+
for (const name of names(args.services, "services"))
|
|
190
|
+
out.push(`--service=${name}`);
|
|
191
|
+
if (args.tail !== undefined) {
|
|
192
|
+
if (!Number.isInteger(args.tail) || args.tail < 1) {
|
|
193
|
+
throw new Error("tail must be a positive integer");
|
|
194
|
+
}
|
|
195
|
+
out.push(`--tail=${args.tail}`);
|
|
196
|
+
}
|
|
197
|
+
if (args.since !== undefined) {
|
|
198
|
+
if (typeof args.since !== "string" || !SINCE.test(args.since)) {
|
|
199
|
+
throw new Error("since must be a duration such as 30s, 5m or 1h");
|
|
200
|
+
}
|
|
201
|
+
out.push(`--since=${args.since}`);
|
|
202
|
+
}
|
|
203
|
+
return out;
|
|
204
|
+
}
|
|
205
|
+
const OBJECT = (properties) => ({
|
|
206
|
+
type: "object",
|
|
207
|
+
properties,
|
|
208
|
+
additionalProperties: false,
|
|
209
|
+
});
|
|
210
|
+
const PROJECT_PATH = {
|
|
211
|
+
type: "string",
|
|
212
|
+
description: "Absolute path to the Flisk project root; run this operation from that directory.",
|
|
213
|
+
};
|
|
214
|
+
function projectPath(value) {
|
|
215
|
+
if (value === undefined)
|
|
216
|
+
return undefined;
|
|
217
|
+
if (typeof value !== "string" || !isAbsolute(value)) {
|
|
218
|
+
throw new Error("projectPath must be an absolute path to a Flisk project root");
|
|
219
|
+
}
|
|
220
|
+
return value;
|
|
221
|
+
}
|
|
222
|
+
export function createTdkTools(run = runTdkCli, up = defaultUpDeps) {
|
|
223
|
+
const viaCli = (build) => async (args) => toToolResult(await run(build(args), { cwd: projectPath(args.projectPath) }));
|
|
224
|
+
return [
|
|
225
|
+
{
|
|
226
|
+
name: "doctor",
|
|
227
|
+
description: "Check whether this machine can run the Flisk stack. Optionally set projectPath to include checks for a specific Flisk project. Returns data.ready and data.host.canUp; run it before `up`.",
|
|
228
|
+
inputSchema: OBJECT({
|
|
229
|
+
projectPath: PROJECT_PATH,
|
|
230
|
+
noPing: { type: "boolean", description: "Skip pinging running services' health endpoints" },
|
|
231
|
+
}),
|
|
232
|
+
handler: viaCli((args) => [
|
|
233
|
+
"doctor",
|
|
234
|
+
"--json",
|
|
235
|
+
...(flag(args.noPing, "noPing") ? ["--no-ping"] : []),
|
|
236
|
+
]),
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
name: "up",
|
|
240
|
+
description: "Start the stack (or part of it) detached from the optional projectPath and return without waiting for it to be ready. Poll `status` for data.tilt.readiness.ready. Fails fast on an unknown service, an unsupported host, or a Tilt already running.",
|
|
241
|
+
inputSchema: OBJECT({
|
|
242
|
+
projectPath: PROJECT_PATH,
|
|
243
|
+
stack: { type: "string", description: "Only this stack" },
|
|
244
|
+
only: {
|
|
245
|
+
type: "array",
|
|
246
|
+
items: { type: "string" },
|
|
247
|
+
description: "Start only these services plus what they depend on and shared infrastructure",
|
|
248
|
+
},
|
|
249
|
+
force: { type: "boolean", description: "Replace a Tilt that is already running" },
|
|
250
|
+
dryRun: { type: "boolean", description: "Show what would be started without starting" },
|
|
251
|
+
waitSeconds: {
|
|
252
|
+
type: "number",
|
|
253
|
+
description: "How long to watch for an early failure before returning (default 15, max 60)",
|
|
254
|
+
},
|
|
255
|
+
}),
|
|
256
|
+
handler: (args) => startUp(args, up),
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
name: "down",
|
|
260
|
+
description: "Stop the running stack, optionally selecting its project with projectPath.",
|
|
261
|
+
inputSchema: OBJECT({
|
|
262
|
+
projectPath: PROJECT_PATH,
|
|
263
|
+
dryRun: { type: "boolean", description: "Show what would be stopped without stopping" },
|
|
264
|
+
}),
|
|
265
|
+
handler: viaCli((args) => [
|
|
266
|
+
"down",
|
|
267
|
+
"--json",
|
|
268
|
+
...(flag(args.dryRun, "dryRun") ? ["--dry-run"] : []),
|
|
269
|
+
]),
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
name: "status",
|
|
273
|
+
description: "Stacks, resources, their ingress URLs and container ports, the stack-level ports, and Tilt readiness (data.tilt.readiness: ready, pending, failures, enabled; null when no Tilt answers). Optionally select the project with projectPath.",
|
|
274
|
+
inputSchema: OBJECT({ projectPath: PROJECT_PATH }),
|
|
275
|
+
handler: viaCli(() => ["status", "--json"]),
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
name: "logs",
|
|
279
|
+
description: "A bounded snapshot of recent logs from the running stack (default the last 200 lines, at most 10000). Optionally select the project with projectPath. Not a stream.",
|
|
280
|
+
inputSchema: OBJECT({
|
|
281
|
+
projectPath: PROJECT_PATH,
|
|
282
|
+
services: { type: "array", items: { type: "string" }, description: "Only these services" },
|
|
283
|
+
tail: { type: "integer", minimum: 1, maximum: 10000 },
|
|
284
|
+
since: {
|
|
285
|
+
type: "string",
|
|
286
|
+
description: "Only logs newer than this, for example 30s, 5m, 1h",
|
|
287
|
+
},
|
|
288
|
+
}),
|
|
289
|
+
handler: viaCli(buildLogsArgs),
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
name: "resource_list",
|
|
293
|
+
description: "List the selected project's services (resources) with their stack, type and port. Set projectPath when the MCP server is not running from the project root.",
|
|
294
|
+
inputSchema: OBJECT({
|
|
295
|
+
projectPath: PROJECT_PATH,
|
|
296
|
+
stack: { type: "string", description: "Only this stack" },
|
|
297
|
+
}),
|
|
298
|
+
handler: viaCli((args) => {
|
|
299
|
+
const stack = optionalName(args.stack, "stack");
|
|
300
|
+
return ["resources", "--json", ...(stack ? [`--stack=${stack}`] : [])];
|
|
301
|
+
}),
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
name: "restart_resource",
|
|
305
|
+
description: "Restart a running resource in the stack (or trigger its rebuild). Set projectPath when the MCP server is not running from the project root.",
|
|
306
|
+
inputSchema: OBJECT({
|
|
307
|
+
projectPath: PROJECT_PATH,
|
|
308
|
+
resource: { type: "string", description: "Name of the resource to restart" },
|
|
309
|
+
}),
|
|
310
|
+
handler: viaCli((args) => {
|
|
311
|
+
const resource = optionalName(args.resource, "resource");
|
|
312
|
+
if (!resource)
|
|
313
|
+
throw new Error("resource is required");
|
|
314
|
+
return ["restart", resource, "--json"];
|
|
315
|
+
}),
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
name: "list_agents",
|
|
319
|
+
description: "List AI agent resources (appType: 'agent') in the project with their stack, runtime, durability and port. Set projectPath when the MCP server is not running from the project root.",
|
|
320
|
+
inputSchema: OBJECT({
|
|
321
|
+
projectPath: PROJECT_PATH,
|
|
322
|
+
stack: { type: "string", description: "Only this stack" },
|
|
323
|
+
}),
|
|
324
|
+
handler: viaCli((args) => {
|
|
325
|
+
const stack = optionalName(args.stack, "stack");
|
|
326
|
+
return ["resources", "--type=agent", "--json", ...(stack ? [`--stack=${stack}`] : [])];
|
|
327
|
+
}),
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
name: "get_agent_sessions",
|
|
331
|
+
description: "Inspect session checkpoints from a running AI agent resource. Set projectPath when the MCP server is not running from the project root.",
|
|
332
|
+
inputSchema: {
|
|
333
|
+
...OBJECT({
|
|
334
|
+
projectPath: PROJECT_PATH,
|
|
335
|
+
resource: { type: "string", description: "Name of the agent resource" },
|
|
336
|
+
sessionId: { type: "string", description: "Session ID to fetch (required)" },
|
|
337
|
+
}),
|
|
338
|
+
required: ["resource", "sessionId"],
|
|
339
|
+
},
|
|
340
|
+
handler: viaCli((args) => {
|
|
341
|
+
const resource = optionalName(args.resource, "resource");
|
|
342
|
+
if (!resource)
|
|
343
|
+
throw new Error("resource is required");
|
|
344
|
+
const sessionId = optionalName(args.sessionId, "sessionId");
|
|
345
|
+
if (!sessionId)
|
|
346
|
+
throw new Error("sessionId is required");
|
|
347
|
+
return ["agent", "sessions", resource, `--session-id=${sessionId}`, "--json"];
|
|
348
|
+
}),
|
|
349
|
+
},
|
|
350
|
+
];
|
|
351
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
/**
|
|
4
|
+
* The root program.
|
|
5
|
+
*
|
|
6
|
+
* The commands live in `commands/registry.ts`; this module wires them into a Commander program.
|
|
7
|
+
* The shell completion generator reads the same program, so the completions and the CLI can never
|
|
8
|
+
* disagree about which commands and flags exist.
|
|
9
|
+
*/
|
|
10
|
+
import chalk from "chalk";
|
|
11
|
+
import { Command } from "commander";
|
|
12
|
+
import pkg from "../package.json" with { type: "json" };
|
|
13
|
+
import { showHelp } from "./commands/help.js";
|
|
14
|
+
import { getRegisteredCommands } from "./commands/registry.js";
|
|
15
|
+
/** Builds the root program with every registered command. */
|
|
16
|
+
export function createProgram() {
|
|
17
|
+
const program = new Command();
|
|
18
|
+
program
|
|
19
|
+
.name("flisk")
|
|
20
|
+
.description("Flisk CLI — start services on your machine.")
|
|
21
|
+
.version(pkg.version, "-v, --version", "Display version number")
|
|
22
|
+
.option("--verbose", "Enable verbose output", false)
|
|
23
|
+
.configureOutput({
|
|
24
|
+
outputError: (str, write) => write(chalk.red(str)),
|
|
25
|
+
writeOut: (str) => process.stdout.write(str),
|
|
26
|
+
writeErr: (str) => process.stderr.write(str),
|
|
27
|
+
});
|
|
28
|
+
program.helpCommand("help [command]", "Show colorful help").on("--help", () => {
|
|
29
|
+
showHelp();
|
|
30
|
+
process.exit(0);
|
|
31
|
+
});
|
|
32
|
+
program.addHelpText("before", "");
|
|
33
|
+
for (const command of getRegisteredCommands()) {
|
|
34
|
+
program.addCommand(command);
|
|
35
|
+
}
|
|
36
|
+
return program;
|
|
37
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { RESOURCE_DEFAULTS_FILE, TECH_STACK_FILE } from "../utils/constants.js";
|
|
4
|
+
export const RESOURCE_CONFIG_APP_TYPES = [
|
|
5
|
+
"backend",
|
|
6
|
+
"frontend",
|
|
7
|
+
"library",
|
|
8
|
+
"sdk",
|
|
9
|
+
"worker",
|
|
10
|
+
"migrator",
|
|
11
|
+
"mcp",
|
|
12
|
+
"agent",
|
|
13
|
+
"bring-your-own",
|
|
14
|
+
];
|
|
15
|
+
export const CREATABLE_RESOURCE_TYPES = [
|
|
16
|
+
"backend",
|
|
17
|
+
"frontend",
|
|
18
|
+
"worker",
|
|
19
|
+
"mcp",
|
|
20
|
+
"agent",
|
|
21
|
+
"bring-your-own",
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* Every value `flisk resource --type` accepts: the creatable types plus `sdk`, which registers a
|
|
25
|
+
* package that already exists instead of scaffolding one.
|
|
26
|
+
*/
|
|
27
|
+
export const RESOURCE_TYPE_VALUES = [...CREATABLE_RESOURCE_TYPES, "sdk"];
|
|
28
|
+
export function isCreatableResourceType(value) {
|
|
29
|
+
return (typeof value === "string" && CREATABLE_RESOURCE_TYPES.includes(value));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Type guard to validate filename is a known master config file.
|
|
33
|
+
* Eliminates the need for 'as MasterConfigFileName' assertion.
|
|
34
|
+
*/
|
|
35
|
+
export function isMasterConfigFileName(filename) {
|
|
36
|
+
const validNames = [TECH_STACK_FILE, RESOURCE_DEFAULTS_FILE, "spec.master"];
|
|
37
|
+
return validNames.includes(filename);
|
|
38
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
export const WEBCONTAINER_DOCS = "docs/agent-hosts.md";
|
|
5
|
+
export const WEBCONTAINER_UP_MESSAGE = `WebContainers cannot run Flisk: there is no Docker daemon or Tilt. Run \`flisk up\` on a machine with Docker. See ${WEBCONTAINER_DOCS}.`;
|
|
6
|
+
export const DEVCONTAINER_DOCKER_FIX = `Docker is not reachable from this Dev Container. Mount the host Docker socket (-v /var/run/docker.sock:/var/run/docker.sock) or add the docker-outside-of-docker feature to devcontainer.json, then retry. Docker-in-docker is not supported. See ${WEBCONTAINER_DOCS}.`;
|
|
7
|
+
function defaultInputs() {
|
|
8
|
+
return {
|
|
9
|
+
env: process.env,
|
|
10
|
+
versions: process.versions,
|
|
11
|
+
platform: process.platform,
|
|
12
|
+
fileExists: existsSync,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/** Classify where the CLI is running. Informational: Docker reachability is still decided by the runtime checks. */
|
|
16
|
+
export function detectHost(inputs = defaultInputs()) {
|
|
17
|
+
const { env, versions, platform, fileExists } = inputs;
|
|
18
|
+
if (versions.webcontainer) {
|
|
19
|
+
return { kind: "webcontainer", canUp: false };
|
|
20
|
+
}
|
|
21
|
+
if (env.CODESPACES === "true")
|
|
22
|
+
return { kind: "codespaces", canUp: true };
|
|
23
|
+
if (env.REMOTE_CONTAINERS || (fileExists("/.dockerenv") && env.DEVCONTAINER)) {
|
|
24
|
+
return { kind: "devcontainer", canUp: true };
|
|
25
|
+
}
|
|
26
|
+
// Mirrors nativeWindowsUpRefusal in commands/up.ts: native Windows is inspect-only unless explicitly overridden.
|
|
27
|
+
if (platform === "win32") {
|
|
28
|
+
return { kind: "native-windows", canUp: env.TDK_ALLOW_NATIVE_WINDOWS === "1" };
|
|
29
|
+
}
|
|
30
|
+
if (platform === "linux" && env.WSL_DISTRO_NAME)
|
|
31
|
+
return { kind: "wsl2", canUp: true };
|
|
32
|
+
return { kind: "local", canUp: true };
|
|
33
|
+
}
|
|
34
|
+
export function isContainerHost(kind) {
|
|
35
|
+
return kind === "devcontainer" || kind === "codespaces";
|
|
36
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { randomBytes } from "node:crypto";
|
|
4
|
+
import { closeSync, fchmodSync, fsyncSync, openSync, renameSync, rmSync, statSync, writeFileSync, } from "node:fs";
|
|
5
|
+
import { basename, dirname, join } from "node:path";
|
|
6
|
+
/**
|
|
7
|
+
* Replaces `filePath` in one step. A plain writeFileSync truncates first, so an interrupt mid-write leaves a
|
|
8
|
+
* half-written file that looks current; here readers see the old content or the new content, never a mix.
|
|
9
|
+
*/
|
|
10
|
+
export function writeTextFileAtomic(filePath, content) {
|
|
11
|
+
const tempPath = join(dirname(filePath), `.${basename(filePath)}.${process.pid}.${randomBytes(4).toString("hex")}.tmp`);
|
|
12
|
+
let mode;
|
|
13
|
+
try {
|
|
14
|
+
mode = statSync(filePath).mode & 0o777;
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
mode = undefined;
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
const fd = openSync(tempPath, "wx");
|
|
21
|
+
try {
|
|
22
|
+
if (mode !== undefined)
|
|
23
|
+
fchmodSync(fd, mode);
|
|
24
|
+
writeFileSync(fd, content, "utf-8");
|
|
25
|
+
fsyncSync(fd);
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
closeSync(fd);
|
|
29
|
+
}
|
|
30
|
+
renameSync(tempPath, filePath);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
rmSync(tempPath, { force: true });
|
|
34
|
+
throw error;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Copyright (c) 2026 Flisk Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { MIN_BUN_VERSION, versionMeetsMinimum } from "../commands/doctor.js";
|
|
4
|
+
/** The Bun floor `flisk doctor` enforces, so `flisk up` cannot drift from it. */
|
|
5
|
+
export function bunMeetsFloor(version) {
|
|
6
|
+
return versionMeetsMinimum(version, MIN_BUN_VERSION);
|
|
7
|
+
}
|
|
8
|
+
/** "1.2+" for a floor of 1.2.0, the wording the preflight already printed. */
|
|
9
|
+
export const BUN_FLOOR_LABEL = `${MIN_BUN_VERSION[0]}.${MIN_BUN_VERSION[1]}+`;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { isApiServiceType } from "./resource-kind.js";
|
|
2
|
+
/**
|
|
3
|
+
* Bun runs the generated JS services. A project without any has nothing for Bun to run, so neither `flisk doctor` nor
|
|
4
|
+
* `flisk up` needs it. Doctor and the start-up preflight share this rule so they cannot disagree.
|
|
5
|
+
*/
|
|
6
|
+
export function projectNeedsBun(resources) {
|
|
7
|
+
return resources.some((resource) => isApiServiceType(resource.config?.appType) ||
|
|
8
|
+
resource.config?.appType === "frontend" ||
|
|
9
|
+
resource.config?.appType === "worker");
|
|
10
|
+
}
|