@flisk-sh/flisk 0.0.0-stage → 1.3.189

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.
Files changed (440) hide show
  1. package/CHANGELOG.md +492 -0
  2. package/LICENSE +21 -0
  3. package/README.md +479 -2
  4. package/Tiltfile +151 -0
  5. package/cli/bin/flisk.js +42 -0
  6. package/cli/dist/agent-runtimes/custom.js +335 -0
  7. package/cli/dist/agent-runtimes/registry.js +34 -0
  8. package/cli/dist/backend-frameworks/elysia.js +38 -0
  9. package/cli/dist/backend-frameworks/express.js +49 -0
  10. package/cli/dist/backend-frameworks/fastify.js +43 -0
  11. package/cli/dist/backend-frameworks/h3.js +37 -0
  12. package/cli/dist/backend-frameworks/koa.js +47 -0
  13. package/cli/dist/backend-frameworks/mcp.js +86 -0
  14. package/cli/dist/backend-frameworks/nestjs.js +55 -0
  15. package/cli/dist/backend-frameworks/registry.js +134 -0
  16. package/cli/dist/backend-frameworks/types.js +1 -0
  17. package/cli/dist/backend-languages/bun.js +76 -0
  18. package/cli/dist/backend-languages/go.js +125 -0
  19. package/cli/dist/backend-languages/node.js +122 -0
  20. package/cli/dist/backend-languages/python.js +94 -0
  21. package/cli/dist/backend-languages/registry.js +37 -0
  22. package/cli/dist/backend-languages/rust.js +82 -0
  23. package/cli/dist/backend-languages/types.js +1 -0
  24. package/cli/dist/cli.js +29 -0
  25. package/cli/dist/commands/__tests__/project-e2e-helpers.js +49 -0
  26. package/cli/dist/commands/__tests__/ui-loading-screen.test.js +16 -0
  27. package/cli/dist/commands/agent.js +182 -0
  28. package/cli/dist/commands/completion-candidates.js +116 -0
  29. package/cli/dist/commands/completion.js +843 -0
  30. package/cli/dist/commands/config.js +362 -0
  31. package/cli/dist/commands/doctor.js +1504 -0
  32. package/cli/dist/commands/down.js +114 -0
  33. package/cli/dist/commands/eject.js +108 -0
  34. package/cli/dist/commands/help.js +152 -0
  35. package/cli/dist/commands/import.js +164 -0
  36. package/cli/dist/commands/logs.js +119 -0
  37. package/cli/dist/commands/maintainers.js +102 -0
  38. package/cli/dist/commands/mcp.js +28 -0
  39. package/cli/dist/commands/networks.js +306 -0
  40. package/cli/dist/commands/project.js +447 -0
  41. package/cli/dist/commands/projects.js +103 -0
  42. package/cli/dist/commands/registry.js +53 -0
  43. package/cli/dist/commands/resource.js +992 -0
  44. package/cli/dist/commands/resources.js +127 -0
  45. package/cli/dist/commands/restart.js +89 -0
  46. package/cli/dist/commands/runtime.js +75 -0
  47. package/cli/dist/commands/stack.js +171 -0
  48. package/cli/dist/commands/stacks.js +71 -0
  49. package/cli/dist/commands/status.js +211 -0
  50. package/cli/dist/commands/ui.js +725 -0
  51. package/cli/dist/commands/up.js +609 -0
  52. package/cli/dist/commands/upgrade.js +840 -0
  53. package/cli/dist/commands/version.js +10 -0
  54. package/cli/dist/components/Accessible.js +11 -0
  55. package/cli/dist/components/BaseTooltip.js +30 -0
  56. package/cli/dist/components/DetailPanel.js +33 -0
  57. package/cli/dist/components/FileTree.js +51 -0
  58. package/cli/dist/components/ResourceSelectInput.js +42 -0
  59. package/cli/dist/components/ResourceTable.js +35 -0
  60. package/cli/dist/components/ServiceIssues.js +13 -0
  61. package/cli/dist/components/TUIHeader.js +27 -0
  62. package/cli/dist/components/TabBar.js +27 -0
  63. package/cli/dist/components/Tooltip.js +13 -0
  64. package/cli/dist/components/index.js +11 -0
  65. package/cli/dist/components/ui-theme.js +120 -0
  66. package/cli/dist/config/platform-standards.js +182 -0
  67. package/cli/dist/frontend-frameworks/lit.js +64 -0
  68. package/cli/dist/frontend-frameworks/preact.js +62 -0
  69. package/cli/dist/frontend-frameworks/qwik.js +61 -0
  70. package/cli/dist/frontend-frameworks/react.js +69 -0
  71. package/cli/dist/frontend-frameworks/registry.js +83 -0
  72. package/cli/dist/frontend-frameworks/solid.js +62 -0
  73. package/cli/dist/frontend-frameworks/svelte.js +67 -0
  74. package/cli/dist/frontend-frameworks/tanstack-router.js +101 -0
  75. package/cli/dist/frontend-frameworks/types.js +1 -0
  76. package/cli/dist/frontend-frameworks/vanilla.js +59 -0
  77. package/cli/dist/frontend-frameworks/vue.js +72 -0
  78. package/cli/dist/generator/__tests__/golden-helpers.js +43 -0
  79. package/cli/dist/generator/extension-fetch.js +291 -0
  80. package/cli/dist/generator/resource-templates.js +133 -0
  81. package/cli/dist/generator/template-engine.js +801 -0
  82. package/cli/dist/index.js +10 -0
  83. package/cli/dist/mcp/server.js +101 -0
  84. package/cli/dist/mcp/tools.js +351 -0
  85. package/cli/dist/program.js +37 -0
  86. package/cli/dist/types/index.js +38 -0
  87. package/cli/dist/utils/agent-host.js +36 -0
  88. package/cli/dist/utils/atomic-write.js +36 -0
  89. package/cli/dist/utils/bun-floor.js +9 -0
  90. package/cli/dist/utils/bun-requirement.js +10 -0
  91. package/cli/dist/utils/cache.js +63 -0
  92. package/cli/dist/utils/cold-preflight.js +257 -0
  93. package/cli/dist/utils/command-helpers.js +57 -0
  94. package/cli/dist/utils/constants.js +160 -0
  95. package/cli/dist/utils/discovery-context.js +71 -0
  96. package/cli/dist/utils/discovery-paths.js +93 -0
  97. package/cli/dist/utils/docker.js +34 -0
  98. package/cli/dist/utils/doctor-crashloop.js +161 -0
  99. package/cli/dist/utils/doctor-fix.js +391 -0
  100. package/cli/dist/utils/doctor-host.js +66 -0
  101. package/cli/dist/utils/doctor-report.js +78 -0
  102. package/cli/dist/utils/doctor-runtime.js +880 -0
  103. package/cli/dist/utils/doctor-starlark.js +132 -0
  104. package/cli/dist/utils/doctor-wiring.js +698 -0
  105. package/cli/dist/utils/down-cleanup.js +125 -0
  106. package/cli/dist/utils/env-validator.js +266 -0
  107. package/cli/dist/utils/errors.js +175 -0
  108. package/cli/dist/utils/exec-async.js +31 -0
  109. package/cli/dist/utils/file-helpers.js +104 -0
  110. package/cli/dist/utils/formatting.js +165 -0
  111. package/cli/dist/utils/generated-paths.js +51 -0
  112. package/cli/dist/utils/help-command.js +11 -0
  113. package/cli/dist/utils/host-port-config.js +140 -0
  114. package/cli/dist/utils/host-port-plan.js +100 -0
  115. package/cli/dist/utils/json-output.js +29 -0
  116. package/cli/dist/utils/machine-output.js +33 -0
  117. package/cli/dist/utils/paths.js +43 -0
  118. package/cli/dist/utils/platform.js +58 -0
  119. package/cli/dist/utils/port-assignment.js +75 -0
  120. package/cli/dist/utils/port-conflict-fix.js +25 -0
  121. package/cli/dist/utils/port-fallback-notice.js +17 -0
  122. package/cli/dist/utils/port-listener-probe.js +20 -0
  123. package/cli/dist/utils/project-config-defaults.js +17 -0
  124. package/cli/dist/utils/project-features.js +91 -0
  125. package/cli/dist/utils/project-templates.js +32 -0
  126. package/cli/dist/utils/prompt.js +97 -0
  127. package/cli/dist/utils/resource-features.js +184 -0
  128. package/cli/dist/utils/resource-kind.js +9 -0
  129. package/cli/dist/utils/schema-version-gate.js +45 -0
  130. package/cli/dist/utils/search-status.js +12 -0
  131. package/cli/dist/utils/secret-redaction.js +73 -0
  132. package/cli/dist/utils/service-config-checks.js +189 -0
  133. package/cli/dist/utils/service-manifest.js +254 -0
  134. package/cli/dist/utils/service-runtime-state.js +66 -0
  135. package/cli/dist/utils/service-urls.js +112 -0
  136. package/cli/dist/utils/services.js +360 -0
  137. package/cli/dist/utils/shared-infra.js +45 -0
  138. package/cli/dist/utils/shared-platform-postgres.js +232 -0
  139. package/cli/dist/utils/single-flight.js +21 -0
  140. package/cli/dist/utils/smoke.js +401 -0
  141. package/cli/dist/utils/spinner.js +40 -0
  142. package/cli/dist/utils/stack-features.js +15 -0
  143. package/cli/dist/utils/stack-status.js +14 -0
  144. package/cli/dist/utils/startup-report.js +78 -0
  145. package/cli/dist/utils/status-message.js +21 -0
  146. package/cli/dist/utils/status-ports.js +33 -0
  147. package/cli/dist/utils/suggestions.js +63 -0
  148. package/cli/dist/utils/tar.js +46 -0
  149. package/cli/dist/utils/tdk-version.js +51 -0
  150. package/cli/dist/utils/terminal-layout.js +19 -0
  151. package/cli/dist/utils/tilt-events.js +194 -0
  152. package/cli/dist/utils/tilt-logs.js +61 -0
  153. package/cli/dist/utils/tilt-port-owner.js +63 -0
  154. package/cli/dist/utils/tilt-process.js +54 -0
  155. package/cli/dist/utils/tilt-resource-state.js +32 -0
  156. package/cli/dist/utils/tilt-startup.js +49 -0
  157. package/cli/dist/utils/tilt-unreachable-message.js +9 -0
  158. package/cli/dist/utils/tilt.js +104 -0
  159. package/cli/dist/utils/ui-keymap.js +129 -0
  160. package/cli/dist/utils/ui-service-state.js +34 -0
  161. package/cli/dist/utils/up-only.js +28 -0
  162. package/cli/dist/utils/up-readiness.js +118 -0
  163. package/cli/dist/utils/url-actions.js +103 -0
  164. package/cli/dist/utils/validation.js +62 -0
  165. package/cli/dist/utils/which.js +56 -0
  166. package/cli/dist/utils/windows-doctor.js +176 -0
  167. package/cli/dist-bundle/chunk-6EA4DGCY.js +2 -0
  168. package/cli/dist-bundle/chunk-BZ4H7MM4.js +3 -0
  169. package/cli/dist-bundle/chunk-QWYXYAX6.js +510 -0
  170. package/cli/dist-bundle/cli.js +2017 -0
  171. package/cli/dist-bundle/cold-preflight-MM46GFQA.js +2 -0
  172. package/cli/dist-bundle/devtools-ZUHXW33W.js +5 -0
  173. package/cli/dist-bundle/extension-fetch-J4FFH7TJ.js +2 -0
  174. package/cli/package.json +83 -0
  175. package/cli/shared-platform-engineering/docker-templates/bun-hoisted-symlink-fix.sh +25 -0
  176. package/cli/shared-platform-engineering/docker-templates/infisical-entrypoint.sh +466 -0
  177. package/cli/shared-platform-engineering/docker-templates/install-deps.sh +154 -0
  178. package/cli/shared-platform-engineering/docker-templates/prisma-bun-client-link-fix.sh +14 -0
  179. package/cli/shared-platform-engineering/docker-templates/prisma-normalize-client.sh +58 -0
  180. package/cli/templates/.tiltignore.hbs +72 -0
  181. package/cli/templates/TILT_RESOURCE_DEFAULTS.star.hbs +220 -0
  182. package/cli/templates/TILT_TECH_STACK.star.hbs +149 -0
  183. package/cli/templates/Tiltfile.hbs +381 -0
  184. package/cli/templates/spec.master.hbs +192 -0
  185. package/discovery/AGENTS.md +362 -0
  186. package/discovery/TILT_DISCOVERY.star +429 -0
  187. package/discovery/Tiltfile +58 -0
  188. package/discovery/config.star +265 -0
  189. package/discovery/constants.star +167 -0
  190. package/discovery/deterministic.star +213 -0
  191. package/discovery/discovery_daemon.star +193 -0
  192. package/discovery/discovery_orchestrator.star +492 -0
  193. package/discovery/filtering.star +7 -0
  194. package/discovery/identity-management-backend/service.yaml +26 -0
  195. package/discovery/identity-management-frontend/service.yaml +29 -0
  196. package/discovery/identity-sdk/service.yaml +9 -0
  197. package/discovery/incremental_discovery.star +215 -0
  198. package/discovery/indexing.star +9 -0
  199. package/discovery/json_manifest_scanner.star +57 -0
  200. package/discovery/libraries.star +48 -0
  201. package/discovery/loading.star +25 -0
  202. package/discovery/manifest/constants.star +106 -0
  203. package/discovery/manifest/loading.star +418 -0
  204. package/discovery/manifest/normalize.star +289 -0
  205. package/discovery/manifest/validation.star +110 -0
  206. package/discovery/normalization.star +13 -0
  207. package/discovery/registry.star +562 -0
  208. package/discovery/resource_snapshot.py +384 -0
  209. package/discovery/resource_snapshot.star +145 -0
  210. package/discovery/schemas.star +3 -0
  211. package/discovery/services/platform/cdc/debezium/nats-connector/service.yaml +9 -0
  212. package/discovery/services/platform/cdc/nats-http-bridge/service.yaml +9 -0
  213. package/discovery/services/platform/orchestrator/orchestrator-glue-backend/service.yaml +26 -0
  214. package/discovery/services/platform/synthetic-monitor/service.yaml +9 -0
  215. package/discovery/test_resource_snapshot.py +253 -0
  216. package/discovery/validation.star +80 -0
  217. package/discovery/versioning.star +3 -0
  218. package/engine/AGENTS.md +706 -0
  219. package/engine/README.md +31 -0
  220. package/engine/REFACTORING_MANIFEST_SYSTEM.md +974 -0
  221. package/engine/Tiltfile +86 -0
  222. package/engine/assets/docker/golden-layers.Dockerfile +204 -0
  223. package/engine/assets/docker/wake-gateway/Dockerfile +28 -0
  224. package/engine/assets/docker/wake-gateway/decide.test.ts +177 -0
  225. package/engine/assets/docker/wake-gateway/decide.ts +135 -0
  226. package/engine/assets/docker/wake-gateway/server.ts +363 -0
  227. package/engine/assets/scripts/cleanup-completed-migrator-images.sh +39 -0
  228. package/engine/assets/scripts/cleanup-tilt-images.sh +122 -0
  229. package/engine/assets/scripts/mac-m1-resource-monitor.sh +123 -0
  230. package/engine/config.star +5 -0
  231. package/engine/entrypoint.star +101 -0
  232. package/engine/lifecycle/orchestrator.star +263 -0
  233. package/engine/paths.star +719 -0
  234. package/engine/schemas/project-schema.json +147 -0
  235. package/engine/schemas/service-schema.json +537 -0
  236. package/engine/scripts/README.md +89 -0
  237. package/engine/scripts/build-and-publish-lib.sh +207 -0
  238. package/engine/scripts/check-lib-publish.sh +87 -0
  239. package/engine/scripts/debug-container.sh +265 -0
  240. package/engine/scripts/generate-manifest.sh +200 -0
  241. package/engine/spec.master +702 -0
  242. package/engine/spec.master.example +341 -0
  243. package/engine/topologies/README.md +33 -0
  244. package/engine/topologies/platform/docker/AGENTS.md +59 -0
  245. package/engine/topologies/platform/docker/auth/auth.star +207 -0
  246. package/engine/topologies/platform/docker/build/frontend_build_plan.star +65 -0
  247. package/engine/topologies/platform/docker/build/golden_image.star +37 -0
  248. package/engine/topologies/platform/docker/build/golden_image_build.star +144 -0
  249. package/engine/topologies/platform/docker/build/golden_image_constants.star +100 -0
  250. package/engine/topologies/platform/docker/build/golden_image_dockerfile.star +263 -0
  251. package/engine/topologies/platform/docker/compose/compose.star +637 -0
  252. package/engine/topologies/platform/docker/compose/compose_helpers.star +54 -0
  253. package/engine/topologies/platform/docker/compose/traefik_standalone.star +171 -0
  254. package/engine/topologies/platform/docker/config/bunignore.star +144 -0
  255. package/engine/topologies/platform/docker/config/dockerignore.star +152 -0
  256. package/engine/topologies/platform/docker/config/healthcheck.star +58 -0
  257. package/engine/topologies/platform/docker/constants.star +211 -0
  258. package/engine/topologies/platform/docker/dockerfile/dockerfile.star +56 -0
  259. package/engine/topologies/platform/docker/dockerfile/language_dockerfile.star +264 -0
  260. package/engine/topologies/platform/docker/generators/golden_docker_generator_v2.star +76 -0
  261. package/engine/topologies/platform/docker/index.star +40 -0
  262. package/engine/topologies/platform/docker/layers/bun_helpers.star +25 -0
  263. package/engine/topologies/platform/docker/layers/infisical/index.star +42 -0
  264. package/engine/topologies/platform/docker/layers/infisical/infisical_docker.star +264 -0
  265. package/engine/topologies/platform/docker/layers/l1_base_layers.star +89 -0
  266. package/engine/topologies/platform/docker/layers/l2_dependency_layers.star +147 -0
  267. package/engine/topologies/platform/docker/layers/l3_builder_layers.star +229 -0
  268. package/engine/topologies/platform/docker/layers/l4_runtime_layers.star +282 -0
  269. package/engine/topologies/platform/docker/layers/prisma/constants.star +138 -0
  270. package/engine/topologies/platform/docker/layers/prisma/db_readiness.star +98 -0
  271. package/engine/topologies/platform/docker/layers/prisma/filesystem_setup.star +131 -0
  272. package/engine/topologies/platform/docker/layers/prisma/migrate_script.star +100 -0
  273. package/engine/topologies/platform/docker/layers/prisma/prisma_build.star +128 -0
  274. package/engine/topologies/platform/docker/layers/prisma/prisma_runtime.star +205 -0
  275. package/engine/topologies/platform/docker/layers/prisma/secret_resolution.star +121 -0
  276. package/engine/topologies/platform/docker/networking/api_path_constants.star +206 -0
  277. package/engine/topologies/platform/docker/networking/sablier_container_cycle.star +31 -0
  278. package/engine/topologies/platform/docker/networking/traefik.star +266 -0
  279. package/engine/topologies/platform/docker/networking/traefik_constants.star +148 -0
  280. package/engine/topologies/platform/docker/networking/traefik_helpers.star +162 -0
  281. package/engine/topologies/platform/docker/networking/traefik_static_routes.star +165 -0
  282. package/engine/topologies/platform/docker/secrets/env_secrets.star +74 -0
  283. package/engine/topologies/platform/docker/secrets/infisical.star +109 -0
  284. package/engine/topologies/platform/net/AGENTS.md +64 -0
  285. package/engine/topologies/platform/net/proxy.star +6 -0
  286. package/engine/topologies/platform/registries/local.star +6 -0
  287. package/engine/topologies/platform/registries/verdaccio_loader.star +20 -0
  288. package/engine/topologies/platform/security/AGENTS.md +49 -0
  289. package/engine/topologies/platform/security/secrets.star +241 -0
  290. package/engine/topologies/platform/state/AGENTS.md +64 -0
  291. package/engine/topologies/platform/state/relational.star +6 -0
  292. package/engine/topologies/tilt/common/AGENTS.md +59 -0
  293. package/engine/topologies/tilt/common/utils.star +409 -0
  294. package/engine/topologies/tilt/common/utils_debug.star +71 -0
  295. package/engine/topologies/tilt/common/utils_deterministic.star +170 -0
  296. package/engine/topologies/tilt/common/utils_docker_networks.star +54 -0
  297. package/engine/topologies/tilt/common/utils_env.star +92 -0
  298. package/engine/topologies/tilt/common/utils_output.star +99 -0
  299. package/engine/topologies/tilt/config/AGENTS.md +68 -0
  300. package/engine/topologies/tilt/config/defaults.star +5 -0
  301. package/engine/topologies/tilt/config/feature_flags.star +12 -0
  302. package/engine/topologies/tilt/config/global.star +57 -0
  303. package/engine/topologies/tilt/config/profiles.star +398 -0
  304. package/engine/topologies/tilt/generators/agents_md.star +64 -0
  305. package/engine/topologies/tilt/generators/api_gateway.star +147 -0
  306. package/engine/topologies/tilt/generators/index.star +126 -0
  307. package/engine/topologies/tilt/generators/infisical/README.md +424 -0
  308. package/engine/topologies/tilt/generators/infisical/examples.star +314 -0
  309. package/engine/topologies/tilt/generators/infisical/index.star +59 -0
  310. package/engine/topologies/tilt/generators/infisical/machine_identity.star +422 -0
  311. package/engine/topologies/tilt/generators/infisical/organization.star +536 -0
  312. package/engine/topologies/tilt/generators/infisical/path_manager.star +478 -0
  313. package/engine/topologies/tilt/generators/infisical/secrets_generator.star +422 -0
  314. package/engine/topologies/tilt/generators/nginx_conf.star +145 -0
  315. package/engine/topologies/tilt/generators/npmrc.star +132 -0
  316. package/engine/topologies/tilt/generators/tsconfig.star +25 -0
  317. package/engine/topologies/tilt/generators/typescript/backend_library_tsconfig.star +73 -0
  318. package/engine/topologies/tilt/generators/typescript/backend_tsconfig.star +137 -0
  319. package/engine/topologies/tilt/generators/typescript/common.star +9 -0
  320. package/engine/topologies/tilt/generators/typescript/frontend_library_tsconfig.star +78 -0
  321. package/engine/topologies/tilt/generators/typescript/frontend_tsconfig.star +140 -0
  322. package/engine/topologies/tilt/generators/typescript/include.star +25 -0
  323. package/engine/topologies/tilt/generators/typescript/playwright_config.star +42 -0
  324. package/engine/topologies/tilt/generators/typescript/prisma_config.star +51 -0
  325. package/engine/topologies/tilt/generators/validators.star +868 -0
  326. package/engine/topologies/tilt/generators/vite/backend.star +80 -0
  327. package/engine/topologies/tilt/generators/vite/frameworks/lit.star +92 -0
  328. package/engine/topologies/tilt/generators/vite/frameworks/preact.star +94 -0
  329. package/engine/topologies/tilt/generators/vite/frameworks/qwik.star +94 -0
  330. package/engine/topologies/tilt/generators/vite/frameworks/react.star +128 -0
  331. package/engine/topologies/tilt/generators/vite/frameworks/solid.star +94 -0
  332. package/engine/topologies/tilt/generators/vite/frameworks/svelte.star +94 -0
  333. package/engine/topologies/tilt/generators/vite/frameworks/vanilla.star +92 -0
  334. package/engine/topologies/tilt/generators/vite/frameworks/vue.star +94 -0
  335. package/engine/topologies/tilt/generators/vite/frontend.star +153 -0
  336. package/engine/topologies/tilt/generators/vite/generators.star +45 -0
  337. package/engine/topologies/tilt/generators/vite/helpers.star +256 -0
  338. package/engine/topologies/tilt/generators/vite/library.star +67 -0
  339. package/engine/topologies/tilt/generators/vite/sdk.star +75 -0
  340. package/engine/topologies/tilt/generators/vite/templates.star +460 -0
  341. package/engine/topologies/tilt/generators/vite_config.star +24 -0
  342. package/engine/topologies/tilt/manifest/AGENTS.md +61 -0
  343. package/engine/topologies/tilt/manifest/README.md +679 -0
  344. package/engine/topologies/tilt/manifest/__init__.star +220 -0
  345. package/engine/topologies/tilt/manifest/constants.star +262 -0
  346. package/engine/topologies/tilt/manifest/errors.star +268 -0
  347. package/engine/topologies/tilt/manifest/integration.star +348 -0
  348. package/engine/topologies/tilt/manifest/json_to_yaml.py +61 -0
  349. package/engine/topologies/tilt/manifest/loader.star +239 -0
  350. package/engine/topologies/tilt/manifest/mapper.star +229 -0
  351. package/engine/topologies/tilt/manifest/parser.star +490 -0
  352. package/engine/topologies/tilt/manifest/schema.star +502 -0
  353. package/engine/topologies/tilt/manifest/tests/test_integration.star +278 -0
  354. package/engine/topologies/tilt/manifest/tests/test_loader_parser.star +475 -0
  355. package/engine/topologies/tilt/manifest/tests/test_manifest.star +319 -0
  356. package/engine/topologies/tilt/manifest/tests/test_validator.star +472 -0
  357. package/engine/topologies/tilt/manifest/validator.star +744 -0
  358. package/engine/topologies/tilt/manifest/yaml_to_json.py +20 -0
  359. package/engine/topologies/tilt/resources/AGENTS.md +71 -0
  360. package/engine/topologies/tilt/resources/build_concurrency.star +56 -0
  361. package/engine/topologies/tilt/resources/conditions.star +5 -0
  362. package/engine/topologies/tilt/resources/databases.star +246 -0
  363. package/engine/topologies/tilt/resources/declaration.star +5 -0
  364. package/engine/topologies/tilt/resources/deps.star +5 -0
  365. package/engine/topologies/tilt/resources/infra-loader.star +504 -0
  366. package/engine/topologies/tilt/resources/libs.star +32 -0
  367. package/engine/topologies/tilt/resources/libs_discovery.star +104 -0
  368. package/engine/topologies/tilt/resources/libs_paths.star +81 -0
  369. package/engine/topologies/tilt/resources/libs_resource_definition.star +153 -0
  370. package/engine/topologies/tilt/resources/libs_setup.star +166 -0
  371. package/engine/topologies/tilt/resources/libs_tsconfig.star +39 -0
  372. package/engine/topologies/tilt/resources/orchestrator/apply.star +79 -0
  373. package/engine/topologies/tilt/resources/orchestrator/apply_compose_resource_registration.star +864 -0
  374. package/engine/topologies/tilt/resources/orchestrator/apply_manifest_orchestration.star +90 -0
  375. package/engine/topologies/tilt/resources/orchestrator/apply_migrator_orchestration.star +150 -0
  376. package/engine/topologies/tilt/resources/orchestrator/apply_resource_validation.star +38 -0
  377. package/engine/topologies/tilt/resources/orchestrator/apply_runtime_flags.star +46 -0
  378. package/engine/topologies/tilt/resources/orchestrator/builders/typescript.star +193 -0
  379. package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/AGENTS.md +75 -0
  380. package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/index.star +23 -0
  381. package/engine/topologies/tilt/resources/orchestrator/generators/dependencies/resolver.star +136 -0
  382. package/engine/topologies/tilt/resources/orchestrator/generators/env.star +219 -0
  383. package/engine/topologies/tilt/resources/orchestrator/generators/frontend.star +172 -0
  384. package/engine/topologies/tilt/resources/orchestrator/generators/manifest_resource.star +577 -0
  385. package/engine/topologies/tilt/resources/orchestrator/helpers.star +35 -0
  386. package/engine/topologies/tilt/resources/orchestrator.star +56 -0
  387. package/engine/topologies/tilt/resources/ordering.star +5 -0
  388. package/engine/topologies/tilt/resources/shared-platform-postgres.star +30 -0
  389. package/engine/topologies/tilt/resources/triggers.star +5 -0
  390. package/engine/topologies/tilt/resources/watchers.star +304 -0
  391. package/engine/where-things-live.star +719 -0
  392. package/examples/tdk-example/LICENSE +21 -0
  393. package/examples/tdk-example/README.md +23 -0
  394. package/examples/tdk-example/TILT_SERVICE_DEFAULTS.star +42 -0
  395. package/examples/tdk-example/TILT_TECH_STACK.star +67 -0
  396. package/examples/tdk-example/Tiltfile +25 -0
  397. package/examples/tdk-example/services/platform/messaging/docker-compose.yml +26 -0
  398. package/examples/tdk-example/services/shop/orders-api/package.json +20 -0
  399. package/examples/tdk-example/services/shop/orders-api/service.json +14 -0
  400. package/examples/tdk-example/services/shop/orders-api/src/index.ts +81 -0
  401. package/examples/tdk-example/services/shop/orders-app/index.html +12 -0
  402. package/examples/tdk-example/services/shop/orders-app/package.json +23 -0
  403. package/examples/tdk-example/services/shop/orders-app/public/.gitkeep +0 -0
  404. package/examples/tdk-example/services/shop/orders-app/service.json +9 -0
  405. package/examples/tdk-example/services/shop/orders-app/src/main.tsx +9 -0
  406. package/examples/tdk-example/services/shop/orders-app/src/orders.tsx +67 -0
  407. package/examples/tdk-example/services/shop/orders-app/src/style.css +15 -0
  408. package/examples/tdk-example/services/shop/orders-worker/package.json +18 -0
  409. package/examples/tdk-example/services/shop/orders-worker/service.json +13 -0
  410. package/examples/tdk-example/services/shop/orders-worker/src/index.ts +33 -0
  411. package/ext/Tiltfile +66 -0
  412. package/ext/ide-components/README.md +221 -0
  413. package/ext/ide-components/code_viewer/server.py +208 -0
  414. package/ext/ide-components/config_inspector/server.py +1052 -0
  415. package/ext/ide-components/file_browser/server.py +287 -0
  416. package/ext/ide-components/shared/config_service.py +471 -0
  417. package/ext/ide-components/shared/file_utils.py +300 -0
  418. package/ext/ide-components/shared/http_utils.py +234 -0
  419. package/ext/ide-components/shared/static/styles.css +1334 -0
  420. package/ext/ide-components/shared/syntax_highlighter.py +142 -0
  421. package/ext/ide-components/shared/template_engine.py +125 -0
  422. package/ext/ide-components/shared/templates/base.html +121 -0
  423. package/ext/ide-components/shared/test_config_service.py +328 -0
  424. package/ext/ide-components/shared/tilt_integration.py +160 -0
  425. package/ext/ui-enhancements/cron-status-server.sh +51 -0
  426. package/ext/ui-enhancements/cron-status-tracker.sh +148 -0
  427. package/ext/ui-enhancements/extension.yaml +36 -0
  428. package/ext/ui-enhancements/tiltfile.py +101 -0
  429. package/ext/ui-enhancements/ui/cron-jobs-tab.css +396 -0
  430. package/ext/ui-enhancements/ui/help-panel.css +279 -0
  431. package/ext/ui-enhancements/ui/icons.css +125 -0
  432. package/ext/ui-enhancements/ui/tooltips.css +114 -0
  433. package/package.json +94 -4
  434. package/shared-platform-engineering/docker-templates/bun-hoisted-symlink-fix.sh +25 -0
  435. package/shared-platform-engineering/docker-templates/infisical-entrypoint.sh +466 -0
  436. package/shared-platform-engineering/docker-templates/install-deps.sh +154 -0
  437. package/shared-platform-engineering/docker-templates/prisma-bun-client-link-fix.sh +14 -0
  438. package/shared-platform-engineering/docker-templates/prisma-normalize-client.sh +58 -0
  439. package/specs/specs/TILT_SERVICE_DEFAULTS.star +207 -0
  440. package/specs/specs/TILT_TECH_STACK.star +161 -0
@@ -0,0 +1,268 @@
1
+ # Copyright (c) 2026 Flisk Landscape contributors
2
+ # SPDX-License-Identifier: MIT
3
+ # =============================================================================
4
+ # 📋 MANIFEST MODULE - ERROR HANDLING
5
+ # =============================================================================
6
+ # Path: .tilt/topologies/tilt/manifest/errors.star
7
+ # Purpose: Standardized error types and handling for manifest system
8
+ # Status: Phase 1 of manifest system refactoring
9
+ # =============================================================================
10
+
11
+ # Error severity levels
12
+ SEVERITY = {
13
+ 'CRITICAL': 'critical', # Must fix, system won't function
14
+ 'ERROR': 'error', # Should fix, may cause issues
15
+ 'WARNING': 'warning', # Should consider, non-blocking
16
+ 'INFO': 'info', # Informational only
17
+ 'DEPRECATION': 'deprecation', # Feature will be removed
18
+ }
19
+
20
+ # Error categories
21
+ CATEGORY = {
22
+ 'SCHEMA': 'schema', # Schema violations
23
+ 'VALIDATION': 'validation', # Value validation failures
24
+ 'IO': 'io', # File I/O errors
25
+ 'PARSE': 'parse', # JSON parsing errors
26
+ 'DEPENDENCY': 'dependency', # Service dependency issues
27
+ 'CONFIG': 'config', # Configuration errors
28
+ 'RUNTIME': 'runtime', # Runtime errors
29
+ 'NETWORK': 'network', # Network/remote fetch errors
30
+ }
31
+
32
+ # Common error messages
33
+ ERROR_MESSAGES = {
34
+ 'MISSING_REQUIRED_FIELD': 'Missing required field: {field}',
35
+ 'INVALID_FIELD_TYPE': 'Field {field} has invalid type: expected {expected}, got {actual}',
36
+ 'INVALID_FIELD_VALUE': 'Field {field} has invalid value: {value}',
37
+ 'FIELD_OUT_OF_RANGE': 'Field {field} value {value} is outside valid range [{min}, {max}]',
38
+ 'INVALID_PATTERN': 'Field {field} value does not match required pattern: {pattern}',
39
+ 'INVALID_ENUM': 'Field {field} value {value} is not in allowed values: {allowed}',
40
+ 'FILE_NOT_FOUND': 'Manifest file not found: {path}',
41
+ 'FILE_EMPTY': 'Manifest file is empty: {path}',
42
+ 'INVALID_JSON': 'Invalid JSON in manifest file: {path} - {error}',
43
+ 'DEPENDENCY_NOT_FOUND': 'Dependency {dependency} not found for service {service}',
44
+ 'CIRCULAR_DEPENDENCY': 'Circular dependency detected: {path}',
45
+ 'PORT_CONFLICT': 'Port {port} is already used by service {existing_service}',
46
+ 'DUPLICATE_RESOURCE_NAME': 'Duplicate service name: {name}',
47
+ 'INVALID_APP_TYPE': 'Invalid app type {appType} for service {service}',
48
+ 'MISSING_BACKEND': 'Frontend {service} is missing backendName field',
49
+ 'MISSING_DATABASE': 'Service {service} has prisma feature but no databaseName',
50
+ }
51
+
52
+ def new_error(message, category, severity, context=None):
53
+ """
54
+ Create a standardized error struct.
55
+
56
+ Args:
57
+ message: Human-readable error message
58
+ category: Error category (from CATEGORY)
59
+ severity: Error severity (from SEVERITY)
60
+ context: Optional dict with:
61
+ - field: Field name if field-specific
62
+ - path: File path
63
+ - value: Invalid value
64
+ - expected: Expected value/type
65
+ - suggestion: Suggested fix
66
+
67
+ Returns:
68
+ Error struct
69
+ """
70
+ return struct(
71
+ message=message,
72
+ category=category,
73
+ severity=severity,
74
+ context=context or {},
75
+ timestamp=None, # Tilt doesn't have time functions, set externally if needed
76
+ )
77
+
78
+ def format_error(error):
79
+ """
80
+ Format error for display.
81
+
82
+ Args:
83
+ error: Error struct
84
+
85
+ Returns:
86
+ Formatted string
87
+ """
88
+ base = "[{severity}] {category}: {message}".format(
89
+ severity=error.severity.upper(),
90
+ category=error.category.upper(),
91
+ message=error.message,
92
+ )
93
+
94
+ if error.context:
95
+ if 'field' in error.context:
96
+ base += " (field: {field})".format(field=error.context['field'])
97
+ if 'path' in error.context:
98
+ base += " @ {path}".format(path=error.context['path'])
99
+ if 'suggestion' in error.context:
100
+ base += "\n 💡 Suggestion: {suggestion}".format(
101
+ suggestion=error.context['suggestion']
102
+ )
103
+
104
+ return base
105
+
106
+ def group_errors(errors):
107
+ """
108
+ Group errors by category and severity.
109
+
110
+ Args:
111
+ errors: List of error structs
112
+
113
+ Returns:
114
+ Dict with errors grouped by category and severity
115
+ """
116
+ grouped = {}
117
+
118
+ for error in errors:
119
+ cat = error.category
120
+ sev = error.severity
121
+
122
+ if cat not in grouped:
123
+ grouped[cat] = {}
124
+
125
+ if sev not in grouped[cat]:
126
+ grouped[cat][sev] = []
127
+
128
+ grouped[cat][sev].append(error)
129
+
130
+ return grouped
131
+
132
+ def has_critical_errors(errors):
133
+ """
134
+ Check if any critical errors exist.
135
+
136
+ Args:
137
+ errors: List of error structs
138
+
139
+ Returns:
140
+ True if any critical errors exist
141
+ """
142
+ for error in errors:
143
+ if error.severity == SEVERITY['CRITICAL']:
144
+ return True
145
+ return False
146
+
147
+ def has_errors(errors, min_severity='ERROR'):
148
+ """
149
+ Check if any errors of specified severity or higher exist.
150
+
151
+ Args:
152
+ errors: List of error structs
153
+ min_severity: Minimum severity to check (ERROR, WARNING, etc.)
154
+
155
+ Returns:
156
+ True if any matching errors exist
157
+ """
158
+ severity_order = ['INFO', 'DEPRECATION', 'WARNING', 'ERROR', 'CRITICAL']
159
+ min_idx = severity_order.index(min_severity)
160
+
161
+ for error in errors:
162
+ error_idx = severity_order.index(error.severity)
163
+ if error_idx >= min_idx:
164
+ return True
165
+
166
+ return False
167
+
168
+ def filter_errors(errors, category=None, severity=None):
169
+ """
170
+ Filter errors by category and/or severity.
171
+
172
+ Args:
173
+ errors: List of error structs
174
+ category: Optional category to filter by
175
+ severity: Optional severity to filter by
176
+
177
+ Returns:
178
+ Filtered list of errors
179
+ """
180
+ filtered = []
181
+
182
+ for error in errors:
183
+ if category and error.category != category:
184
+ continue
185
+ if severity and error.severity != severity:
186
+ continue
187
+ filtered.append(error)
188
+
189
+ return filtered
190
+
191
+ def get_error_summary(errors):
192
+ """
193
+ Get a summary of errors by category and severity.
194
+
195
+ Args:
196
+ errors: List of error structs
197
+
198
+ Returns:
199
+ Summary dict with counts
200
+ """
201
+ summary = {
202
+ 'total': len(errors),
203
+ 'by_severity': {
204
+ 'CRITICAL': 0,
205
+ 'ERROR': 0,
206
+ 'WARNING': 0,
207
+ 'INFO': 0,
208
+ 'DEPRECATION': 0,
209
+ },
210
+ 'by_category': {},
211
+ }
212
+
213
+ for error in errors:
214
+ summary['by_severity'][error.severity] += 1
215
+
216
+ cat = error.category
217
+ if cat not in summary['by_category']:
218
+ summary['by_category'][cat] = 0
219
+ summary['by_category'][cat] += 1
220
+
221
+ return summary
222
+
223
+ def create_field_error(field_name, field_value, error_type, **kwargs):
224
+ """
225
+ Convenience function to create field-specific errors.
226
+
227
+ Args:
228
+ field_name: Name of the field with error
229
+ field_value: The invalid value
230
+ error_type: Type of error (key in ERROR_MESSAGES)
231
+ **kwargs: Additional context for error message formatting
232
+
233
+ Returns:
234
+ Error struct
235
+ """
236
+ message_template = ERROR_MESSAGES.get(error_type, 'Unknown error for field {field}')
237
+
238
+ context = {
239
+ 'field': field_name,
240
+ 'value': field_value,
241
+ }
242
+ context.update(kwargs)
243
+
244
+ message = message_template.format(**context)
245
+
246
+ return new_error(
247
+ message=message,
248
+ category=CATEGORY['VALIDATION'],
249
+ severity=SEVERITY['ERROR'],
250
+ context=context,
251
+ )
252
+
253
+ # Export all error handling functions and constants
254
+ ManifestErrors = struct(
255
+ SEVERITY=SEVERITY,
256
+ CATEGORY=CATEGORY,
257
+ ERROR_MESSAGES=ERROR_MESSAGES,
258
+ new=new_error,
259
+ format=format_error,
260
+ group=group_errors,
261
+ has_critical=has_critical_errors,
262
+ has_errors=has_errors,
263
+ filter=filter_errors,
264
+ get_summary=get_error_summary,
265
+ create_field_error=create_field_error,
266
+ )
267
+
268
+ VALIDATION = {}
@@ -0,0 +1,348 @@
1
+ # Copyright (c) 2026 Flisk Landscape contributors
2
+ # SPDX-License-Identifier: MIT
3
+ # =============================================================================
4
+ # 📋 MANIFEST MODULE - DISCOVERY INTEGRATION (Phase 5 Complete)
5
+ # =============================================================================
6
+ # Path: .tilt/topologies/tilt/manifest/integration.star
7
+ # Purpose: Integration layer between new manifest module and discovery system
8
+ # Status: Phase 5 COMPLETE - Fully integrated, backward compatibility removed
9
+ #
10
+ # This module provides the bridge between the new manifest system and the
11
+ # discovery infrastructure. Phase 5 complete - using new system exclusively.
12
+ # =============================================================================
13
+
14
+ load("./__init__.star", "Manifest")
15
+ load("./loader.star", "ManifestLoader")
16
+ load("./parser.star", "ManifestParser")
17
+ load("./validator.star", "ManifestValidator")
18
+ load("../resources/shared-platform-postgres.star", "SHARED_POSTGRES_DEPENDENCY_NAMES")
19
+
20
+ # Phase 5: Migration complete - always use new system
21
+ def load_and_validate_manifest(manifest_path, all_manifests=None):
22
+ """
23
+ Load and validate a manifest using the new manifest system.
24
+
25
+ This is the main integration point for discovery.star to use
26
+ the new manifest module. Phase 5: Always uses new system.
27
+
28
+ Args:
29
+ manifest_path: Path to manifest JSON file
30
+ all_manifests: Optional list of all manifests for cross-validation
31
+
32
+ Returns:
33
+ struct(
34
+ manifest=None, # Normalized manifest dict
35
+ error=None, # Error message or None
36
+ warnings=[], # List of warnings
37
+ validation=None, # Validation result struct
38
+ metadata={}, # Loading metadata
39
+ )
40
+ """
41
+
42
+ if load_result.error:
43
+ return struct(
44
+ manifest=None,
45
+ error=load_result.error,
46
+ warnings=load_result.warnings,
47
+ validation=None,
48
+ metadata=load_result.metadata,
49
+ )
50
+
51
+ raw_manifest = load_result.manifest
52
+ resource_path = ManifestParser.extract_resource_path(manifest_path)
53
+
54
+ # Step 2: Parse and normalize
55
+ parse_result = ManifestParser.get_normalized(raw_manifest, resource_path)
56
+
57
+ if parse_result.error:
58
+ return struct(
59
+ manifest=None,
60
+ error=parse_result.error,
61
+ warnings=parse_result.warnings + load_result.warnings,
62
+ validation=None,
63
+ metadata=load_result.metadata,
64
+ )
65
+
66
+ normalized_manifest = parse_result.manifest
67
+ all_warnings = parse_result.warnings + load_result.warnings
68
+
69
+ # Step 3: Validate
70
+ context = {'resource_path': resource_path}
71
+ if all_manifests:
72
+ context['all_manifests'] = all_manifests
73
+
74
+ validation_result = ManifestValidator.validate(normalized_manifest, context, level='all')
75
+
76
+ # Add validation warnings to list
77
+ for warning in validation_result.warnings:
78
+ all_warnings.append(Manifest.format_error(warning))
79
+
80
+ return struct(
81
+ manifest=normalized_manifest,
82
+ error=None,
83
+ warnings=all_warnings,
84
+ validation=validation_result,
85
+ metadata=load_result.metadata,
86
+ )
87
+
88
+ def load_all_manifests(services_root, filters=None, validate=False):
89
+ """
90
+ Load all manifests with optional validation.
91
+
92
+ Integration wrapper for Manifest.load_all() with additional
93
+ processing for discovery system compatibility.
94
+
95
+ Args:
96
+ services_root: Root directory to search
97
+ filters: Optional filters (appType, stack, features)
98
+ validate: Whether to validate each manifest
99
+
100
+ Returns:
101
+ struct(
102
+ manifests=[], # List of normalized manifests
103
+ errors=[], # List of errors
104
+ warnings=[], # List of warnings
105
+ stats={}, # Loading statistics
106
+ by_name={}, # Dict mapping appName to manifest
107
+ by_port={}, # Dict mapping port to manifest
108
+ )
109
+ """
110
+ # Use the new loader
111
+ load_result = ManifestLoader.load_all(services_root, filters)
112
+
113
+ manifests = []
114
+ errors = []
115
+ warnings = []
116
+ by_name = {}
117
+ by_port = {}
118
+
119
+ # Normalize each manifest
120
+ for raw_manifest in load_result.manifests:
121
+ resource_path = raw_manifest.get('_resource_path', '')
122
+
123
+ # Normalize
124
+ parse_result = ManifestParser.get_normalized(raw_manifest, resource_path)
125
+
126
+ if parse_result.error:
127
+ errors.append(parse_result.error)
128
+ continue
129
+
130
+ normalized = parse_result.manifest
131
+ manifests.append(normalized)
132
+
133
+ # Build lookup maps
134
+ app_name = normalized.get('appName')
135
+ if app_name:
136
+ by_name[app_name] = normalized
137
+
138
+ port = normalized.get('port')
139
+ if port:
140
+ by_port[port] = normalized
141
+
142
+ # Collect warnings
143
+ warnings.extend(parse_result.warnings)
144
+
145
+ # Add loading errors
146
+ for error in load_result.errors:
147
+ errors.append(ManifestErrors.format(error))
148
+
149
+ # Validate if requested
150
+ if validate:
151
+ for manifest in manifests:
152
+ context = {
153
+ 'all_manifests': manifests,
154
+ 'resource_path': manifest.get('_resource_path', ''),
155
+ }
156
+
157
+ validation = ManifestValidator.validate(manifest, context, level='cross_service')
158
+
159
+ if not validation.valid:
160
+ for error in validation.errors:
161
+ errors.append(Manifest.format_error(error))
162
+
163
+ return struct(
164
+ manifests=manifests,
165
+ errors=errors,
166
+ warnings=warnings,
167
+ stats=load_result.stats,
168
+ by_name=by_name,
169
+ by_port=by_port,
170
+ )
171
+
172
+ def convert_to_resource_format(manifest):
173
+ """
174
+ Convert normalized manifest to discovery resource format.
175
+
176
+ This ensures compatibility with the existing discovery system
177
+ by converting the new manifest format to the expected resource format.
178
+
179
+ Args:
180
+ manifest: Normalized manifest dict
181
+
182
+ Returns:
183
+ Resource dict in discovery format
184
+ """
185
+ app_name = manifest.get('appName', 'unknown')
186
+ app_type = manifest.get('appType', 'backend')
187
+ stack = manifest.get('stack', 'unknown')
188
+ port = manifest.get('port', 4000)
189
+ syncs = manifest.get('syncs', [])
190
+ dockerfile = manifest.get('dockerfile', '.autogenerated/Dockerfile.app.autogenerated')
191
+ resource_path = manifest.get('_resource_path', '')
192
+
193
+ resource = {
194
+ 'name': app_name,
195
+ 'dockerfile': app_name + '/' + dockerfile,
196
+ 'syncs': syncs,
197
+ 'port': port,
198
+ 'stack': stack,
199
+ '_manifest': manifest.get('_manifest', manifest), # Original manifest
200
+ '_resource_path': resource_path,
201
+ '_normalized': True,
202
+ }
203
+
204
+ # Add frontend-specific fields
205
+ if app_type == 'frontend':
206
+ resource['frontend'] = True
207
+ resource['backendName'] = manifest.get('backendName', app_name.replace('-frontend', '-backend'))
208
+
209
+ # Add optional fields
210
+ if manifest.get('target_path'):
211
+ resource['target_path'] = manifest['target_path']
212
+ if manifest.get('prisma_client_path'):
213
+ resource['prisma_client_path'] = manifest['prisma_client_path']
214
+ if manifest.get('registry_host'):
215
+ resource['registry_host'] = manifest['registry_host']
216
+ if manifest.get('start_command'):
217
+ resource['start_command'] = manifest['start_command']
218
+
219
+ return resource
220
+
221
+ def get_validation_summary(manifests):
222
+ """
223
+ Generate validation summary for all manifests.
224
+
225
+ Args:
226
+ manifests: List of manifest dicts
227
+
228
+ Returns:
229
+ Dict with summary statistics
230
+ """
231
+ summary = {
232
+ 'total': len(manifests),
233
+ 'valid': 0,
234
+ 'invalid': 0,
235
+ 'errors': 0,
236
+ 'warnings': 0,
237
+ 'by_severity': {
238
+ 'CRITICAL': 0,
239
+ 'ERROR': 0,
240
+ 'WARNING': 0,
241
+ },
242
+ }
243
+
244
+ for manifest in manifests:
245
+ context = {'all_manifests': manifests}
246
+ result = ManifestValidator.validate(manifest, context, level='all')
247
+
248
+ if result.valid:
249
+ summary['valid'] += 1
250
+ else:
251
+ summary['invalid'] += 1
252
+
253
+ summary['errors'] += len([e for e in result.errors
254
+ if e.severity in ['ERROR', 'CRITICAL']])
255
+ summary['warnings'] += len(result.warnings)
256
+
257
+ for error in result.errors:
258
+ if error.severity in summary['by_severity']:
259
+ summary['by_severity'][error.severity] += 1
260
+
261
+ return summary
262
+
263
+ def check_port_conflicts(manifests):
264
+ """
265
+ Check for port conflicts across all manifests.
266
+
267
+ Args:
268
+ manifests: List of manifest dicts
269
+
270
+ Returns:
271
+ List of conflict error structs
272
+ """
273
+ conflicts = []
274
+ ports = {}
275
+
276
+ for manifest in manifests:
277
+ port = manifest.get('port')
278
+ app_name = manifest.get('appName', 'unknown')
279
+
280
+ if port:
281
+ if port in ports:
282
+ conflicts.append(ManifestErrors.new(
283
+ message="Port {} conflict: {} and {}".format(port, ports[port], app_name),
284
+ category=ManifestErrors.CATEGORY['VALIDATION'],
285
+ severity=ManifestErrors.SEVERITY['ERROR'],
286
+ context={'port': port, 'services': [ports[port], app_name]},
287
+ ))
288
+ else:
289
+ ports[port] = app_name
290
+
291
+ return conflicts
292
+
293
+ def check_dependencies_valid(manifests):
294
+ """
295
+ Check if all dependencies reference valid services.
296
+
297
+ Shared platform Postgres names (`postgres`, `database-management`) are not
298
+ app services; they resolve to the Tilt resource `postgres` and are not
299
+ reported as missing.
300
+
301
+ Args:
302
+ manifests: List of manifest dicts
303
+
304
+ Returns:
305
+ List of dependency error structs
306
+ """
307
+ errors = []
308
+ app_names = {m.get('appName'): m for m in manifests if m.get('appName')}
309
+
310
+ for manifest in manifests:
311
+ app_name = manifest.get('appName', 'unknown')
312
+ internal_deps = manifest.get('dependsOn', [])
313
+
314
+ for dep in internal_deps:
315
+ if dep in SHARED_POSTGRES_DEPENDENCY_NAMES:
316
+ continue
317
+ if dep not in app_names:
318
+ errors.append(ManifestErrors.new(
319
+ message="Service '{}' depends on non-existent service '{}'".format(app_name, dep),
320
+ category=ManifestErrors.CATEGORY['DEPENDENCY'],
321
+ severity=ManifestErrors.SEVERITY['ERROR'],
322
+ context={'service': app_name, 'dependency': dep},
323
+ ))
324
+
325
+ # Check frontend backend references
326
+ if manifest.get('appType') == 'frontend':
327
+ backend_name = manifest.get('backendName', '')
328
+ if backend_name and backend_name not in app_names:
329
+ errors.append(ManifestErrors.new(
330
+ message="Frontend '{}' references non-existent backend '{}'".format(app_name, backend_name),
331
+ category=ManifestErrors.CATEGORY['DEPENDENCY'],
332
+ severity=ManifestErrors.SEVERITY['ERROR'],
333
+ context={'frontend': app_name, 'backend': backend_name},
334
+ ))
335
+
336
+ return errors
337
+
338
+ # Export integration functions
339
+ ManifestIntegration = struct(
340
+ load_and_validate=load_and_validate_manifest,
341
+ load_all=load_all_manifests,
342
+ convert_to_resource=convert_to_resource_format,
343
+ get_validation_summary=get_validation_summary,
344
+ check_port_conflicts=check_port_conflicts,
345
+ check_dependencies_valid=check_dependencies_valid,
346
+ )
347
+
348
+ VALIDATION = {}
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env python3
2
+ # Copyright (c) 2026 Flisk Landscape contributors
3
+ # SPDX-License-Identifier: MIT
4
+ """Convert JSON manifest to Tilt-compatible YAML resource"""
5
+ import sys
6
+ import json
7
+ import yaml
8
+ import uuid
9
+
10
+ if len(sys.argv) < 2:
11
+ print("Usage: json_to_yaml.py <json_file>", file=sys.stderr)
12
+ sys.exit(1)
13
+
14
+ json_file = sys.argv[1]
15
+ try:
16
+ with open(json_file, 'r') as f:
17
+ data = json.load(f)
18
+
19
+ # The YAML is a generated, committed mirror used only for Tilt resource tracking. A secret that someone put in service.json must
20
+ # not be copied into it (the JWT secret belongs in the project .env; `flisk doctor` warns about it).
21
+ data = {key: value for key, value in data.items() if key not in ("jwtSecret",)}
22
+
23
+ # Deterministic: the mirror is regenerated on every run, so a wall-clock time or random uid would change the file each time.
24
+ # The uid is derived from the content, and the timestamp is a fixed epoch (nothing reads it).
25
+ now = "1970-01-01T00:00:00Z"
26
+ uid = str(uuid.uuid5(uuid.NAMESPACE_URL, json.dumps(data, sort_keys=True)))
27
+
28
+ # Match exact Tilt get uiresources format
29
+ tilt_resource = {
30
+ "apiVersion": "tilt.dev/v1alpha1",
31
+ "kind": "UIResource",
32
+ "metadata": {
33
+ "annotations": {
34
+ "tilt.dev/resource": data.get("appName", "unknown")
35
+ },
36
+ "creationTimestamp": now,
37
+ "name": data.get("appName", "unknown"),
38
+ "resourceVersion": "1",
39
+ "uid": uid
40
+ },
41
+ "spec": data,
42
+ "status": {
43
+ "conditions": [
44
+ {
45
+ "lastTransitionTime": now,
46
+ "status": "True",
47
+ "type": "UpToDate"
48
+ }
49
+ ],
50
+ "runtimeStatus": "pending",
51
+ "updateStatus": "ok"
52
+ }
53
+ }
54
+
55
+ print(yaml.dump(tilt_resource,
56
+ default_flow_style=False,
57
+ sort_keys=False,
58
+ allow_unicode=True))
59
+ except Exception as e:
60
+ print(f"Error: {e}", file=sys.stderr)
61
+ sys.exit(1)