@tdk-landscape/tdk-cli-core 1.3.44 → 1.3.48
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/.github/workflows/release-binaries.yml +54 -0
- package/.pre-commit-config.yaml +57 -0
- package/Makefile +92 -0
- package/bun.lock +538 -0
- package/cli/AGENTS.md +390 -0
- package/cli/DESIGN.md +735 -0
- package/cli/biome.json +44 -0
- package/cli/dependency-graph.svg +1135 -0
- package/cli/knip.json +6 -0
- package/cli/package.json +77 -0
- package/cli/pnpm-lock.yaml +2305 -0
- package/cli/pnpm-workspace.yaml +2 -0
- package/cli/shared-platform-engineering/docker-templates/bun-hoisted-symlink-fix.sh +23 -0
- package/cli/shared-platform-engineering/docker-templates/infisical-entrypoint.sh +464 -0
- package/cli/shared-platform-engineering/docker-templates/install-deps.sh +152 -0
- package/cli/shared-platform-engineering/docker-templates/prisma-bun-client-link-fix.sh +12 -0
- package/cli/shared-platform-engineering/docker-templates/prisma-normalize-client.sh +56 -0
- package/{dist/cli.js → cli/src/cli.ts} +21 -13
- package/cli/src/commands/__tests__/always-enabled-infra.test.ts +115 -0
- package/cli/src/commands/__tests__/config.test.ts +146 -0
- package/cli/src/commands/__tests__/doctor.test.ts +557 -0
- package/cli/src/commands/__tests__/error-handling.test.ts +78 -0
- package/cli/src/commands/__tests__/phases-model.test.ts +163 -0
- package/cli/src/commands/__tests__/project-resource-features-e2e.test.ts +207 -0
- package/cli/src/commands/__tests__/project.test.ts +68 -0
- package/cli/src/commands/__tests__/resource.test.ts +226 -0
- package/cli/src/commands/__tests__/saas-starter-integration.test.ts +196 -0
- package/cli/src/commands/__tests__/stack-features-e2e.test.ts +129 -0
- package/cli/src/commands/__tests__/upgrade.test.ts +101 -0
- package/{dist/commands/completion.js → cli/src/commands/completion.ts} +78 -72
- package/cli/src/commands/config.ts +299 -0
- package/cli/src/commands/doctor.ts +790 -0
- package/cli/src/commands/down.ts +37 -0
- package/cli/src/commands/help.ts +150 -0
- package/cli/src/commands/networks-design.md +80 -0
- package/cli/src/commands/networks.ts +332 -0
- package/cli/src/commands/project.ts +439 -0
- package/cli/src/commands/projects.ts +82 -0
- package/cli/src/commands/resource.ts +652 -0
- package/cli/src/commands/resources.ts +95 -0
- package/cli/src/commands/stack.ts +128 -0
- package/cli/src/commands/stacks.ts +52 -0
- package/cli/src/commands/status.ts +88 -0
- package/cli/src/commands/ui.tsx +843 -0
- package/cli/src/commands/up.ts +150 -0
- package/cli/src/commands/upgrade.ts +570 -0
- package/{dist/commands/version.js → cli/src/commands/version.ts} +5 -5
- package/cli/src/components/Accessible.tsx +21 -0
- package/cli/src/components/BaseTooltip.tsx +66 -0
- package/cli/src/components/DetailPanel.tsx +146 -0
- package/cli/src/components/FileTree.tsx +89 -0
- package/cli/src/components/ResourceSelectInput.tsx +30 -0
- package/cli/src/components/ResourceTable.tsx +78 -0
- package/cli/src/components/TabBar.tsx +53 -0
- package/cli/src/components/Tooltip.tsx +11 -0
- package/{dist/components/index.js → cli/src/components/index.ts} +0 -1
- package/cli/src/config/platform-standards.test.ts +11 -0
- package/cli/src/config/platform-standards.ts +196 -0
- package/cli/src/generator/__tests__/extension-fetch.test.ts +220 -0
- package/cli/src/generator/__tests__/template-engine.test.ts +70 -0
- package/cli/src/generator/extension-fetch.ts +279 -0
- package/cli/src/generator/template-engine.ts +754 -0
- package/cli/src/index.ts +86 -0
- package/cli/src/templates.d.ts +4 -0
- package/cli/src/types/index.ts +351 -0
- package/cli/src/utils/__tests__/cache.test.ts +98 -0
- package/cli/src/utils/__tests__/formatting.test.ts +170 -0
- package/cli/src/utils/__tests__/paths.test.ts +180 -0
- package/cli/src/utils/__tests__/port-assignment.test.ts +121 -0
- package/cli/src/utils/__tests__/service-urls.test.ts +174 -0
- package/cli/src/utils/__tests__/services.test.ts +531 -0
- package/cli/src/utils/__tests__/tilt.test.ts +143 -0
- package/cli/src/utils/__tests__/validation.test.ts +148 -0
- package/cli/src/utils/cache.ts +76 -0
- package/cli/src/utils/command-helpers.ts +54 -0
- package/cli/src/utils/constants.ts +126 -0
- package/cli/src/utils/discovery-context.ts +49 -0
- package/cli/src/utils/docker.ts +20 -0
- package/cli/src/utils/doctor-runtime.ts +604 -0
- package/cli/src/utils/env-validator.ts +139 -0
- package/cli/src/utils/errors.ts +168 -0
- package/cli/src/utils/file-helpers.ts +62 -0
- package/cli/src/utils/formatting.ts +215 -0
- package/cli/src/utils/paths.ts +53 -0
- package/cli/src/utils/port-assignment.ts +106 -0
- package/cli/src/utils/project-features.ts +118 -0
- package/cli/src/utils/project-templates.ts +28 -0
- package/cli/src/utils/prompt.ts +123 -0
- package/cli/src/utils/resource-features.ts +209 -0
- package/cli/src/utils/service-urls.ts +124 -0
- package/cli/src/utils/services.ts +363 -0
- package/cli/src/utils/stack-features.ts +30 -0
- package/cli/src/utils/tar.ts +24 -0
- package/cli/src/utils/tilt.ts +113 -0
- package/cli/src/utils/validation.ts +67 -0
- package/{templates → cli/templates}/Tiltfile.hbs +1 -1
- package/cli/tsconfig.json +25 -0
- package/cli/tsconfig.typecheck.json +8 -0
- package/docs/FEATURES.md +279 -0
- package/engine/topologies/platform/docker/dockerfile/dockerfile.star +3 -3
- package/engine/topologies/platform/docker/generators/golden_docker_generator_v2.star +1 -1
- package/engine/topologies/platform/docker/layers/l2_dependency_layers.star +0 -3
- package/engine/topologies/platform/docker/layers/l3_builder_layers.star +1 -1
- package/engine/topologies/platform/docker/layers/l4_runtime_layers.star +1 -1
- package/engine/topologies/platform/docker/secrets/infisical.star +19 -47
- package/engine/topologies/tilt/resources/orchestrator/apply_migrator_orchestration.star +1 -1
- package/install.sh +242 -0
- package/knip.json +10 -0
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/.openspec.yaml +2 -0
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/design.md +102 -0
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/proposal.md +31 -0
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-notifications/spec.md +48 -0
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-orchestration/spec.md +63 -0
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/specs/vscode-tdk-troubleshooting/spec.md +56 -0
- package/openspec/changes/add-vscode-tdk-troubleshooter-plugin/tasks.md +61 -0
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/design.md +114 -0
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/proposal.md +32 -0
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/manifest-field-migration/spec.md +20 -0
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/resource-terminology-standard/spec.md +20 -0
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/specs/stack-terminology-standard/spec.md +20 -0
- package/openspec/changes/archive/2026-04-28-rename-domain-to-stack-service-to-resource/tasks.md +194 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/design.md +111 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/proposal.md +33 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/function-naming-alignment/spec.md +12 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/optional-parameter-patterns/spec.md +18 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-documentation/spec.md +16 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-naming-consistency/spec.md +12 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/specs/parameter-ordering-standard/spec.md +12 -0
- package/openspec/changes/archive/2026-04-28-star-files-parameter-fixes/tasks.md +194 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/codebase-audit-report.md +62 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/design.md +84 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/proposal.md +31 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/codebase-audit/spec.md +27 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/dead-code-cleanup/spec.md +27 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/test-gap-fill/spec.md +23 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/specs/todo-resolution/spec.md +27 -0
- package/openspec/changes/archive/2026-04-29-scan-repo-gaps-fix/tasks.md +39 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/.openspec.yaml +5 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/design.md +94 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/proposal.md +46 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/ai-slop-cleanup/CLEANUP_REPORT_8.md +174 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/ai-slop-cleanup/CRITICAL_ASSESSMENT_8.md +160 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/circular-deps/CRITICAL_ASSESSMENT_4.md +381 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/dead-code/CRITICAL_ASSESSMENT_3.md +316 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/deduplication/CRITICAL_ASSESSMENT_1.md +290 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/deduplication/IMPLEMENTATION_SUMMARY_1.md +233 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/defensive-cleanup/CRITICAL_ASSESSMENT_6.md +835 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/legacy-cleanup/CRITICAL_ASSESSMENT_7.md +254 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/legacy-cleanup/IMPLEMENTATION_SUMMARY_7.md +187 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/strong-typing/CRITICAL_ASSESSMENT_5.md +269 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/type-consolidation/CRITICAL_ASSESSMENT_2.md +312 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/specs/type-consolidation/IMPLEMENTATION_SUMMARY.md +170 -0
- package/openspec/changes/archive/2026-05-04-comprehensive-cleanup-final/tasks.md +137 -0
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/design.md +80 -0
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/proposal.md +40 -0
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/spec.md +52 -0
- package/openspec/changes/archive/2026-06-25-landscape-consolidation/tasks.md +51 -0
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/.openspec.yaml +2 -0
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/design.md +43 -0
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/proposal.md +29 -0
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/specs/self-contained-generated-projects/spec.md +67 -0
- package/openspec/changes/archive/2026-09-17-fix-generated-stack-boot/tasks.md +27 -0
- package/openspec/specs/manifest-field-migration/spec.md +24 -0
- package/openspec/specs/resource-terminology-standard/spec.md +24 -0
- package/openspec/specs/self-contained-generated-projects/spec.md +67 -0
- package/openspec/specs/stack-terminology-standard/spec.md +24 -0
- package/package.json +27 -64
- package/platform/services/platform/proxy/service.yaml +14 -0
- package/scripts/audit-codebase.sh +213 -0
- package/scripts/install-git-hooks.sh +14 -0
- package/scripts/release-binaries.sh +94 -0
- package/scripts/setup-pre-commit.sh +33 -0
- package/scripts/stage-npm-engine.sh +36 -0
- package/shared-platform-engineering/docker-templates/bun-hoisted-symlink-fix.sh +23 -0
- package/shared-platform-engineering/docker-templates/infisical-entrypoint.sh +464 -0
- package/shared-platform-engineering/docker-templates/install-deps.sh +152 -0
- package/shared-platform-engineering/docker-templates/prisma-bun-client-link-fix.sh +12 -0
- package/shared-platform-engineering/docker-templates/prisma-normalize-client.sh +56 -0
- package/tests/tilt-engine/__init__.py +5 -0
- package/tests/tilt-engine/conftest.py +182 -0
- package/tests/tilt-engine/fixtures/appointment-frontend-service.json +11 -0
- package/tests/tilt-engine/fixtures/identity-backend-service.json +12 -0
- package/tests/tilt-engine/fixtures/invalid-service.json +4 -0
- package/tests/tilt-engine/test_agents_md_generator.py +341 -0
- package/tests/tilt-engine/test_agents_md_integration.py +378 -0
- package/tests/tilt-engine/test_cache_operations.py +181 -0
- package/tests/tilt-engine/test_cache_persistence.py +142 -0
- package/tests/tilt-engine/test_code_executor.py +152 -0
- package/tests/tilt-engine/test_code_viewer.py +127 -0
- package/tests/tilt-engine/test_compose_port_anchors.py +310 -0
- package/tests/tilt-engine/test_config_inspector.py +162 -0
- package/tests/tilt-engine/test_daemon_focus_mode.py +89 -0
- package/tests/tilt-engine/test_daemon_polling.py +122 -0
- package/tests/tilt-engine/test_daemon_registration.py +115 -0
- package/tests/tilt-engine/test_daemon_validation.py +107 -0
- package/tests/tilt-engine/test_docker_generator_bugs.py +493 -0
- package/tests/tilt-engine/test_docker_prune.py +119 -0
- package/tests/tilt-engine/test_dockerignore_path_bug.py +82 -0
- package/tests/tilt-engine/test_file_browser.py +193 -0
- package/tests/tilt-engine/test_frontend_basepath_manifest.py +27 -0
- package/tests/tilt-engine/test_health_dependencies.py +130 -0
- package/tests/tilt-engine/test_health_endpoints.py +118 -0
- package/tests/tilt-engine/test_health_tilt_ui.py +85 -0
- package/tests/tilt-engine/test_safety_aliases.py +84 -0
- package/tests/tilt-engine/test_snapshot_diff.py +136 -0
- package/tests/tilt-engine/test_snapshot_persistence.py +163 -0
- package/tests/tilt-engine/test_snapshot_scanning.py +123 -0
- package/tests/tilt-engine/test_standalone_project_boot.py +61 -0
- package/tests/tilt-engine/test_standalone_traefik.py +108 -0
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands/completion.d.ts +0 -3
- package/dist/commands/completion.d.ts.map +0 -1
- package/dist/commands/completion.js.map +0 -1
- package/dist/commands/config.d.ts +0 -3
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/config.js +0 -231
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/doctor.d.ts +0 -7
- package/dist/commands/doctor.d.ts.map +0 -1
- package/dist/commands/doctor.js +0 -597
- package/dist/commands/doctor.js.map +0 -1
- package/dist/commands/down.d.ts +0 -3
- package/dist/commands/down.d.ts.map +0 -1
- package/dist/commands/down.js +0 -32
- package/dist/commands/down.js.map +0 -1
- package/dist/commands/help.d.ts +0 -2
- package/dist/commands/help.d.ts.map +0 -1
- package/dist/commands/help.js +0 -130
- package/dist/commands/help.js.map +0 -1
- package/dist/commands/networks.d.ts +0 -3
- package/dist/commands/networks.d.ts.map +0 -1
- package/dist/commands/networks.js +0 -260
- package/dist/commands/networks.js.map +0 -1
- package/dist/commands/project.d.ts +0 -3
- package/dist/commands/project.d.ts.map +0 -1
- package/dist/commands/project.js +0 -373
- package/dist/commands/project.js.map +0 -1
- package/dist/commands/projects.d.ts +0 -3
- package/dist/commands/projects.d.ts.map +0 -1
- package/dist/commands/projects.js +0 -71
- package/dist/commands/projects.js.map +0 -1
- package/dist/commands/resource.d.ts +0 -69
- package/dist/commands/resource.d.ts.map +0 -1
- package/dist/commands/resource.js +0 -579
- package/dist/commands/resource.js.map +0 -1
- package/dist/commands/resources.d.ts +0 -3
- package/dist/commands/resources.d.ts.map +0 -1
- package/dist/commands/resources.js +0 -73
- package/dist/commands/resources.js.map +0 -1
- package/dist/commands/stack.d.ts +0 -3
- package/dist/commands/stack.d.ts.map +0 -1
- package/dist/commands/stack.js +0 -97
- package/dist/commands/stack.js.map +0 -1
- package/dist/commands/stacks.d.ts +0 -3
- package/dist/commands/stacks.d.ts.map +0 -1
- package/dist/commands/stacks.js +0 -43
- package/dist/commands/stacks.js.map +0 -1
- package/dist/commands/status.d.ts +0 -3
- package/dist/commands/status.d.ts.map +0 -1
- package/dist/commands/status.js +0 -71
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/ui.d.ts +0 -3
- package/dist/commands/ui.d.ts.map +0 -1
- package/dist/commands/ui.js +0 -445
- package/dist/commands/ui.js.map +0 -1
- package/dist/commands/up.d.ts +0 -3
- package/dist/commands/up.d.ts.map +0 -1
- package/dist/commands/up.js +0 -110
- package/dist/commands/up.js.map +0 -1
- package/dist/commands/upgrade.d.ts +0 -11
- package/dist/commands/upgrade.d.ts.map +0 -1
- package/dist/commands/upgrade.js +0 -496
- package/dist/commands/upgrade.js.map +0 -1
- package/dist/commands/version.d.ts +0 -3
- package/dist/commands/version.d.ts.map +0 -1
- package/dist/commands/version.js.map +0 -1
- package/dist/components/Accessible.d.ts +0 -8
- package/dist/components/Accessible.d.ts.map +0 -1
- package/dist/components/Accessible.js +0 -10
- package/dist/components/Accessible.js.map +0 -1
- package/dist/components/BaseTooltip.d.ts +0 -4
- package/dist/components/BaseTooltip.d.ts.map +0 -1
- package/dist/components/BaseTooltip.js +0 -28
- package/dist/components/BaseTooltip.js.map +0 -1
- package/dist/components/DetailPanel.d.ts +0 -4
- package/dist/components/DetailPanel.d.ts.map +0 -1
- package/dist/components/DetailPanel.js +0 -18
- package/dist/components/DetailPanel.js.map +0 -1
- package/dist/components/FileTree.d.ts +0 -4
- package/dist/components/FileTree.d.ts.map +0 -1
- package/dist/components/FileTree.js +0 -47
- package/dist/components/FileTree.js.map +0 -1
- package/dist/components/ResourceSelectInput.d.ts +0 -4
- package/dist/components/ResourceSelectInput.d.ts.map +0 -1
- package/dist/components/ResourceSelectInput.js +0 -7
- package/dist/components/ResourceSelectInput.js.map +0 -1
- package/dist/components/ResourceTable.d.ts +0 -4
- package/dist/components/ResourceTable.d.ts.map +0 -1
- package/dist/components/ResourceTable.js +0 -18
- package/dist/components/ResourceTable.js.map +0 -1
- package/dist/components/TabBar.d.ts +0 -4
- package/dist/components/TabBar.d.ts.map +0 -1
- package/dist/components/TabBar.js +0 -17
- package/dist/components/TabBar.js.map +0 -1
- package/dist/components/Tooltip.d.ts +0 -12
- package/dist/components/Tooltip.d.ts.map +0 -1
- package/dist/components/Tooltip.js +0 -12
- package/dist/components/Tooltip.js.map +0 -1
- package/dist/components/index.d.ts +0 -8
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/config/platform-standards.d.ts +0 -159
- package/dist/config/platform-standards.d.ts.map +0 -1
- package/dist/config/platform-standards.js +0 -181
- package/dist/config/platform-standards.js.map +0 -1
- package/dist/generator/extension-fetch.d.ts +0 -25
- package/dist/generator/extension-fetch.d.ts.map +0 -1
- package/dist/generator/extension-fetch.js +0 -252
- package/dist/generator/extension-fetch.js.map +0 -1
- package/dist/generator/template-engine.d.ts +0 -61
- package/dist/generator/template-engine.d.ts.map +0 -1
- package/dist/generator/template-engine.js +0 -557
- package/dist/generator/template-engine.js.map +0 -1
- package/dist/index.d.ts +0 -11
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -11
- package/dist/index.js.map +0 -1
- package/dist/types/index.d.ts +0 -255
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -17
- package/dist/types/index.js.map +0 -1
- package/dist/utils/cache.d.ts +0 -19
- package/dist/utils/cache.d.ts.map +0 -1
- package/dist/utils/cache.js +0 -64
- package/dist/utils/cache.js.map +0 -1
- package/dist/utils/command-helpers.d.ts +0 -17
- package/dist/utils/command-helpers.d.ts.map +0 -1
- package/dist/utils/command-helpers.js +0 -41
- package/dist/utils/command-helpers.js.map +0 -1
- package/dist/utils/constants.d.ts +0 -52
- package/dist/utils/constants.d.ts.map +0 -1
- package/dist/utils/constants.js +0 -112
- package/dist/utils/constants.js.map +0 -1
- package/dist/utils/discovery-context.d.ts +0 -4
- package/dist/utils/discovery-context.d.ts.map +0 -1
- package/dist/utils/discovery-context.js +0 -39
- package/dist/utils/discovery-context.js.map +0 -1
- package/dist/utils/docker.d.ts +0 -4
- package/dist/utils/docker.d.ts.map +0 -1
- package/dist/utils/docker.js +0 -19
- package/dist/utils/docker.js.map +0 -1
- package/dist/utils/doctor-runtime.d.ts +0 -66
- package/dist/utils/doctor-runtime.d.ts.map +0 -1
- package/dist/utils/doctor-runtime.js +0 -469
- package/dist/utils/doctor-runtime.js.map +0 -1
- package/dist/utils/env-validator.d.ts +0 -15
- package/dist/utils/env-validator.d.ts.map +0 -1
- package/dist/utils/env-validator.js +0 -109
- package/dist/utils/env-validator.js.map +0 -1
- package/dist/utils/errors.d.ts +0 -31
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js +0 -140
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/file-helpers.d.ts +0 -14
- package/dist/utils/file-helpers.d.ts.map +0 -1
- package/dist/utils/file-helpers.js +0 -45
- package/dist/utils/file-helpers.js.map +0 -1
- package/dist/utils/formatting.d.ts +0 -30
- package/dist/utils/formatting.d.ts.map +0 -1
- package/dist/utils/formatting.js +0 -164
- package/dist/utils/formatting.js.map +0 -1
- package/dist/utils/paths.d.ts +0 -3
- package/dist/utils/paths.d.ts.map +0 -1
- package/dist/utils/paths.js +0 -41
- package/dist/utils/paths.js.map +0 -1
- package/dist/utils/port-assignment.d.ts +0 -6
- package/dist/utils/port-assignment.d.ts.map +0 -1
- package/dist/utils/port-assignment.js +0 -81
- package/dist/utils/port-assignment.js.map +0 -1
- package/dist/utils/project-features.d.ts +0 -23
- package/dist/utils/project-features.d.ts.map +0 -1
- package/dist/utils/project-features.js +0 -98
- package/dist/utils/project-features.js.map +0 -1
- package/dist/utils/project-templates.d.ts +0 -7
- package/dist/utils/project-templates.d.ts.map +0 -1
- package/dist/utils/project-templates.js +0 -24
- package/dist/utils/project-templates.js.map +0 -1
- package/dist/utils/prompt.d.ts +0 -28
- package/dist/utils/prompt.d.ts.map +0 -1
- package/dist/utils/prompt.js +0 -79
- package/dist/utils/prompt.js.map +0 -1
- package/dist/utils/resource-features.d.ts +0 -29
- package/dist/utils/resource-features.d.ts.map +0 -1
- package/dist/utils/resource-features.js +0 -171
- package/dist/utils/resource-features.js.map +0 -1
- package/dist/utils/service-urls.d.ts +0 -30
- package/dist/utils/service-urls.d.ts.map +0 -1
- package/dist/utils/service-urls.js +0 -93
- package/dist/utils/service-urls.js.map +0 -1
- package/dist/utils/services.d.ts +0 -18
- package/dist/utils/services.d.ts.map +0 -1
- package/dist/utils/services.js +0 -291
- package/dist/utils/services.js.map +0 -1
- package/dist/utils/stack-features.d.ts +0 -22
- package/dist/utils/stack-features.d.ts.map +0 -1
- package/dist/utils/stack-features.js +0 -13
- package/dist/utils/stack-features.js.map +0 -1
- package/dist/utils/tar.d.ts +0 -7
- package/dist/utils/tar.d.ts.map +0 -1
- package/dist/utils/tar.js +0 -21
- package/dist/utils/tar.js.map +0 -1
- package/dist/utils/tilt.d.ts +0 -19
- package/dist/utils/tilt.d.ts.map +0 -1
- package/dist/utils/tilt.js +0 -78
- package/dist/utils/tilt.js.map +0 -1
- package/dist/utils/validation.d.ts +0 -16
- package/dist/utils/validation.d.ts.map +0 -1
- package/dist/utils/validation.js +0 -58
- package/dist/utils/validation.js.map +0 -1
- /package/{README.md → cli/README.md} +0 -0
- /package/{bin → cli/bin}/tdk.js +0 -0
- /package/{templates → cli/templates}/.tiltignore.hbs +0 -0
- /package/{templates → cli/templates}/TILT_RESOURCE_DEFAULTS.star.hbs +0 -0
- /package/{templates → cli/templates}/TILT_TECH_STACK.star.hbs +0 -0
- /package/{templates → cli/templates}/spec.master.hbs +0 -0
|
@@ -0,0 +1,843 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { Box, render, Text, useApp, useInput, useStdin, useStdout } from "ink";
|
|
3
|
+
import type React from "react";
|
|
4
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
5
|
+
import {
|
|
6
|
+
DetailPanel,
|
|
7
|
+
FileTree,
|
|
8
|
+
ResourceSelectInput,
|
|
9
|
+
ResourceTable,
|
|
10
|
+
TabBar,
|
|
11
|
+
} from "../components/index.js";
|
|
12
|
+
import type {
|
|
13
|
+
DiscoveredResource,
|
|
14
|
+
ErrorScreenProps,
|
|
15
|
+
FileNode,
|
|
16
|
+
HelpPanelProps,
|
|
17
|
+
LoadingScreenProps,
|
|
18
|
+
SelectItem,
|
|
19
|
+
TabId,
|
|
20
|
+
} from "../types/index.js";
|
|
21
|
+
import { errorFactories, requireProjectRoot } from "../utils/errors.js";
|
|
22
|
+
import { findProjectRoot } from "../utils/paths.js";
|
|
23
|
+
import {
|
|
24
|
+
clearMetadataCache,
|
|
25
|
+
discoverResources,
|
|
26
|
+
discoverStacks,
|
|
27
|
+
getResourceMetadata,
|
|
28
|
+
getStackMetadata,
|
|
29
|
+
} from "../utils/services.js";
|
|
30
|
+
import { isTiltAvailable } from "../utils/tilt.js";
|
|
31
|
+
|
|
32
|
+
// biome-ignore lint/correctness/noUnusedFunctionParameters: reserved callback prop kept in the component API
|
|
33
|
+
const HelpPanel: React.FC<HelpPanelProps> = ({ onClose }) => (
|
|
34
|
+
<Box
|
|
35
|
+
borderStyle="single"
|
|
36
|
+
borderColor="cyan"
|
|
37
|
+
paddingX={2}
|
|
38
|
+
paddingY={1}
|
|
39
|
+
flexDirection="column"
|
|
40
|
+
width={60}
|
|
41
|
+
>
|
|
42
|
+
<Text bold color="cyan">
|
|
43
|
+
Keyboard Shortcuts
|
|
44
|
+
</Text>
|
|
45
|
+
<Box marginY={1} flexDirection="column">
|
|
46
|
+
<Text bold underline>
|
|
47
|
+
Navigation
|
|
48
|
+
</Text>
|
|
49
|
+
<Text> ↑/↓ Navigate list items</Text>
|
|
50
|
+
<Text> Enter Select item / Open detail</Text>
|
|
51
|
+
<Text> Space Toggle expand (tree view)</Text>
|
|
52
|
+
<Text> Tab Next tab</Text>
|
|
53
|
+
<Text> 1-5 Direct tab access</Text>
|
|
54
|
+
|
|
55
|
+
<Box marginTop={1}>
|
|
56
|
+
<Text bold underline>
|
|
57
|
+
Actions
|
|
58
|
+
</Text>
|
|
59
|
+
</Box>
|
|
60
|
+
<Text> a Toggle all/pre-alpha services</Text>
|
|
61
|
+
<Text> m Toggle mouse support</Text>
|
|
62
|
+
<Text> t Toggle tooltips</Text>
|
|
63
|
+
<Text> e Toggle enabled/disabled services</Text>
|
|
64
|
+
<Text> r Refresh data</Text>
|
|
65
|
+
<Text> / Search/filter</Text>
|
|
66
|
+
<Text> ? Show this help</Text>
|
|
67
|
+
<Text> q/Esc Quit / Back</Text>
|
|
68
|
+
</Box>
|
|
69
|
+
<Box marginTop={1}>
|
|
70
|
+
<Text color="gray" dimColor>
|
|
71
|
+
Press any key to close...
|
|
72
|
+
</Text>
|
|
73
|
+
</Box>
|
|
74
|
+
</Box>
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const LoadingScreen: React.FC<LoadingScreenProps> = ({ progress, message }) => (
|
|
78
|
+
<Box flexDirection="column" padding={2}>
|
|
79
|
+
<Text bold color="cyan">
|
|
80
|
+
▓▒░ TDK NEON EDITION ░▒▓
|
|
81
|
+
</Text>
|
|
82
|
+
<Box marginY={1} />
|
|
83
|
+
<Text>Loading: {message}</Text>
|
|
84
|
+
<Box marginY={1} borderStyle="single" borderColor="gray" width={50}>
|
|
85
|
+
<Box width={progress / 2} backgroundColor="cyan">
|
|
86
|
+
<Text>{" ".repeat(progress / 2)}</Text>
|
|
87
|
+
</Box>
|
|
88
|
+
<Text> {progress}%</Text>
|
|
89
|
+
</Box>
|
|
90
|
+
</Box>
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
// biome-ignore lint/correctness/noUnusedFunctionParameters: reserved callback prop kept in the component API
|
|
94
|
+
const ErrorScreen: React.FC<ErrorScreenProps> = ({ error, onRetry }) => (
|
|
95
|
+
<Box flexDirection="column" padding={2} alignItems="center">
|
|
96
|
+
<Text bold color="red">
|
|
97
|
+
Connection Error
|
|
98
|
+
</Text>
|
|
99
|
+
<Box marginY={1} />
|
|
100
|
+
<Text color="red">✗ {error}</Text>
|
|
101
|
+
<Box marginY={1} />
|
|
102
|
+
<Text color="gray">Troubleshooting:</Text>
|
|
103
|
+
<Text color="gray"> 1. Is Tilt running? Run: tilt up</Text>
|
|
104
|
+
<Text color="gray"> 2. Check Tiltfile exists</Text>
|
|
105
|
+
<Text color="gray"> 3. Try: tdk status --verbose</Text>
|
|
106
|
+
<Box marginY={1} />
|
|
107
|
+
<Text color="cyan">Press [r] to retry or [q] to quit</Text>
|
|
108
|
+
</Box>
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
const EmptyState: React.FC = () => (
|
|
112
|
+
<Box flexDirection="column" padding={2} alignItems="center">
|
|
113
|
+
<Text bold color="yellow">
|
|
114
|
+
No Services Found
|
|
115
|
+
</Text>
|
|
116
|
+
<Box marginY={1} />
|
|
117
|
+
<Text color="gray">◉ No service.json files found</Text>
|
|
118
|
+
<Box marginY={1} />
|
|
119
|
+
<Text>To get started:</Text>
|
|
120
|
+
<Text> 1. Run: tdk init</Text>
|
|
121
|
+
<Text> 2. Or create services manually</Text>
|
|
122
|
+
<Box marginY={1} />
|
|
123
|
+
<Text color="gray">Press [q] to quit</Text>
|
|
124
|
+
</Box>
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
const TUIApp: React.FC = () => {
|
|
128
|
+
const { exit } = useApp();
|
|
129
|
+
const { stdout } = useStdout();
|
|
130
|
+
const { stdin, setRawMode } = useStdin();
|
|
131
|
+
const [activeTab, setActiveTab] = useState<TabId>("overview");
|
|
132
|
+
const [selectedStack, setSelectedStack] = useState<string | null>(null);
|
|
133
|
+
const [selectedService, setSelectedService] = useState<string | null>(null);
|
|
134
|
+
const [message, setMessage] = useState<string>("");
|
|
135
|
+
const [highlightedIndex, setHighlightedIndex] = useState(0);
|
|
136
|
+
const [showHelp, setShowHelp] = useState(false);
|
|
137
|
+
const [searchQuery, setSearchQuery] = useState("");
|
|
138
|
+
const [isSearching, setIsSearching] = useState(false);
|
|
139
|
+
|
|
140
|
+
const [terminalWidth, setTerminalWidth] = useState(stdout.columns || 120);
|
|
141
|
+
const [selectedFile, setSelectedFile] = useState<string | null>(null);
|
|
142
|
+
const [mouseEnabled, setMouseEnabled] = useState(true);
|
|
143
|
+
const [loading, setLoading] = useState(true);
|
|
144
|
+
const [error, setError] = useState<string | null>(null);
|
|
145
|
+
const [showTooltips, setShowTooltips] = useState(true);
|
|
146
|
+
const [showEnabledOnly, setShowEnabledOnly] = useState(true);
|
|
147
|
+
|
|
148
|
+
const projectRoot = findProjectRoot() || "unknown";
|
|
149
|
+
|
|
150
|
+
const { stacks, services } = useMemo(
|
|
151
|
+
() => ({
|
|
152
|
+
stacks: discoverStacks(),
|
|
153
|
+
services: discoverResources(),
|
|
154
|
+
}),
|
|
155
|
+
[],
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
setLoading(false);
|
|
160
|
+
}, []);
|
|
161
|
+
|
|
162
|
+
useEffect(() => {
|
|
163
|
+
if (services.length === 0) {
|
|
164
|
+
setError('No services found. Run "tdk init" to get started.');
|
|
165
|
+
} else {
|
|
166
|
+
setError(null);
|
|
167
|
+
}
|
|
168
|
+
}, [services.length]);
|
|
169
|
+
|
|
170
|
+
const selectedStackData = useMemo(() => {
|
|
171
|
+
if (!selectedStack) return null;
|
|
172
|
+
const stack = stacks.find((s) => s.name === selectedStack);
|
|
173
|
+
if (!stack) return null;
|
|
174
|
+
return {
|
|
175
|
+
stack,
|
|
176
|
+
metadata: getStackMetadata(stack),
|
|
177
|
+
};
|
|
178
|
+
}, [selectedStack, stacks]);
|
|
179
|
+
|
|
180
|
+
const selectedServiceData = useMemo(() => {
|
|
181
|
+
if (!selectedService) return null;
|
|
182
|
+
const service = services.find((s: DiscoveredResource) => s.name === selectedService);
|
|
183
|
+
if (!service) return null;
|
|
184
|
+
return {
|
|
185
|
+
service,
|
|
186
|
+
metadata: getResourceMetadata(service),
|
|
187
|
+
};
|
|
188
|
+
}, [selectedService, services]);
|
|
189
|
+
|
|
190
|
+
const filteredStacks = useMemo(() => {
|
|
191
|
+
if (!searchQuery) return stacks;
|
|
192
|
+
return stacks.filter(
|
|
193
|
+
(s) =>
|
|
194
|
+
s.name.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
|
195
|
+
s.resources.some((svc: { name: string }) =>
|
|
196
|
+
svc.name.toLowerCase().includes(searchQuery.toLowerCase()),
|
|
197
|
+
),
|
|
198
|
+
);
|
|
199
|
+
}, [stacks, searchQuery]);
|
|
200
|
+
|
|
201
|
+
const filteredServices = useMemo(() => {
|
|
202
|
+
let filtered = services;
|
|
203
|
+
if (showEnabledOnly) {
|
|
204
|
+
filtered = filtered.filter((s: DiscoveredResource) => s.config?.enabled !== false);
|
|
205
|
+
}
|
|
206
|
+
if (searchQuery) {
|
|
207
|
+
filtered = filtered.filter(
|
|
208
|
+
(s: DiscoveredResource) =>
|
|
209
|
+
s.name.toLowerCase().includes(searchQuery.toLowerCase()) ||
|
|
210
|
+
(s.stack || "").toLowerCase().includes(searchQuery.toLowerCase()),
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
return filtered;
|
|
214
|
+
}, [services, searchQuery, showEnabledOnly]);
|
|
215
|
+
|
|
216
|
+
const getItems = useCallback(() => {
|
|
217
|
+
if (activeTab === "overview") {
|
|
218
|
+
return filteredStacks.map((stack) => ({
|
|
219
|
+
label: `${stack.name} (${stack.resources.length} resources)`,
|
|
220
|
+
value: stack.name,
|
|
221
|
+
}));
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
if (activeTab === "resources") {
|
|
225
|
+
if (selectedStackData) {
|
|
226
|
+
return selectedStackData.stack.resources.map((s) => {
|
|
227
|
+
const stackLabel = s.stack && s.stack !== "unknown" ? ` [${s.stack}]` : "";
|
|
228
|
+
const enabledLabel = s.config?.enabled === false ? " [DISABLED]" : "";
|
|
229
|
+
return {
|
|
230
|
+
label: `${s.name}${stackLabel}${enabledLabel}`,
|
|
231
|
+
value: s.name,
|
|
232
|
+
};
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
return filteredStacks.map((stack) => ({
|
|
236
|
+
label: `${stack.name} (${stack.resources.length} resources)`,
|
|
237
|
+
value: stack.name,
|
|
238
|
+
}));
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (activeTab === "files") {
|
|
242
|
+
if (selectedServiceData) {
|
|
243
|
+
return selectedServiceData.metadata.autogeneratedFiles.map((f) => ({
|
|
244
|
+
label: `${f.name} (${f.type})`,
|
|
245
|
+
value: f.path,
|
|
246
|
+
}));
|
|
247
|
+
}
|
|
248
|
+
return filteredServices.map((s: DiscoveredResource) => {
|
|
249
|
+
const stackPrefix = s.stack && s.stack !== "unknown" ? `${s.stack}/` : "";
|
|
250
|
+
const enabledLabel = s.config?.enabled === false ? " [DISABLED]" : "";
|
|
251
|
+
return {
|
|
252
|
+
label: `${stackPrefix}${s.name}${enabledLabel}`,
|
|
253
|
+
value: s.name,
|
|
254
|
+
};
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (activeTab === "config") {
|
|
259
|
+
return filteredServices.map((s: DiscoveredResource) => {
|
|
260
|
+
const stackPrefix = s.stack && s.stack !== "unknown" ? `${s.stack}/` : "";
|
|
261
|
+
const stackLabel = s.stack ? ` [${s.stack}]` : "";
|
|
262
|
+
const enabledLabel = s.config?.enabled === false ? " [DISABLED]" : "";
|
|
263
|
+
return {
|
|
264
|
+
label: `${stackPrefix}${s.name}${stackLabel}${enabledLabel}`,
|
|
265
|
+
value: s.name,
|
|
266
|
+
};
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
return [];
|
|
271
|
+
}, [activeTab, filteredStacks, filteredServices, selectedStackData, selectedServiceData]);
|
|
272
|
+
|
|
273
|
+
const items = getItems();
|
|
274
|
+
|
|
275
|
+
useEffect(() => {
|
|
276
|
+
if (highlightedIndex >= items.length && items.length > 0) {
|
|
277
|
+
setHighlightedIndex(items.length - 1);
|
|
278
|
+
} else if (items.length === 0) {
|
|
279
|
+
setHighlightedIndex(0);
|
|
280
|
+
}
|
|
281
|
+
}, [highlightedIndex, items.length]);
|
|
282
|
+
|
|
283
|
+
const handleSelect = useCallback(
|
|
284
|
+
(item: SelectItem) => {
|
|
285
|
+
if (activeTab === "overview") {
|
|
286
|
+
setSelectedStack(item.value);
|
|
287
|
+
setSelectedService(null);
|
|
288
|
+
setMessage(`Selected stack: ${item.value}`);
|
|
289
|
+
setTimeout(() => setMessage(""), 2000);
|
|
290
|
+
} else if (activeTab === "resources") {
|
|
291
|
+
if (selectedStack && !selectedService) {
|
|
292
|
+
setSelectedService(item.value);
|
|
293
|
+
setMessage(`Selected service: ${item.value}`);
|
|
294
|
+
setTimeout(() => setMessage(""), 2000);
|
|
295
|
+
} else {
|
|
296
|
+
setSelectedStack(item.value);
|
|
297
|
+
setSelectedService(null);
|
|
298
|
+
}
|
|
299
|
+
} else if (activeTab === "files") {
|
|
300
|
+
if (selectedService) {
|
|
301
|
+
setSelectedFile(item.value);
|
|
302
|
+
setMessage(`Selected file: ${item.label}`);
|
|
303
|
+
setTimeout(() => setMessage(""), 2000);
|
|
304
|
+
} else {
|
|
305
|
+
setSelectedService(item.value);
|
|
306
|
+
setMessage(`Selected service: ${item.value}`);
|
|
307
|
+
setTimeout(() => setMessage(""), 2000);
|
|
308
|
+
}
|
|
309
|
+
} else if (activeTab === "config") {
|
|
310
|
+
setSelectedService(item.value);
|
|
311
|
+
setMessage(`Viewing config for: ${item.value}`);
|
|
312
|
+
setTimeout(() => setMessage(""), 2000);
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
[activeTab, selectedStack, selectedService],
|
|
316
|
+
);
|
|
317
|
+
|
|
318
|
+
useEffect(() => {
|
|
319
|
+
setRawMode(true);
|
|
320
|
+
|
|
321
|
+
stdout.write("\x1b[?1000h");
|
|
322
|
+
stdout.write("\x1b[?1006h");
|
|
323
|
+
|
|
324
|
+
return () => {
|
|
325
|
+
setRawMode(false);
|
|
326
|
+
stdout.write("\x1b[?1000l");
|
|
327
|
+
stdout.write("\x1b[?1006l");
|
|
328
|
+
};
|
|
329
|
+
}, [setRawMode, stdout]);
|
|
330
|
+
|
|
331
|
+
useEffect(() => {
|
|
332
|
+
if (!mouseEnabled) return;
|
|
333
|
+
|
|
334
|
+
const handleMouseData = (data: Buffer) => {
|
|
335
|
+
const str = data.toString();
|
|
336
|
+
|
|
337
|
+
// Parse SGR 1006 mouse protocol: ESC[<btn;x;yM or ESC[<btn;x;ym
|
|
338
|
+
// biome-ignore lint/suspicious/noControlCharactersInRegex: \\x1b ESC is intentional (ANSI SGR/CSI sequence parsing)
|
|
339
|
+
const sgrMatch = str.match(/\x1b\[<(\d+);(\d+);(\d+)([Mm])/);
|
|
340
|
+
if (sgrMatch) {
|
|
341
|
+
const btn = parseInt(sgrMatch[1], 10);
|
|
342
|
+
const _x = parseInt(sgrMatch[2], 10);
|
|
343
|
+
const y = parseInt(sgrMatch[3], 10);
|
|
344
|
+
const release = sgrMatch[4] === "m";
|
|
345
|
+
|
|
346
|
+
// Check if it's a left click (btn & 0b11 == 0 means left button)
|
|
347
|
+
const isLeftClick = (btn & 0b11) === 0;
|
|
348
|
+
|
|
349
|
+
if (isLeftClick && !release) {
|
|
350
|
+
// Calculate row in the list (header takes ~6 lines)
|
|
351
|
+
const listRow = y - 7; // Adjust for header, tabs, and borders
|
|
352
|
+
|
|
353
|
+
if (listRow >= 0 && listRow < items.length) {
|
|
354
|
+
setHighlightedIndex(listRow);
|
|
355
|
+
const item = items[listRow];
|
|
356
|
+
if (item) {
|
|
357
|
+
handleSelect(item);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
|
|
365
|
+
stdin.on("data", handleMouseData);
|
|
366
|
+
return () => {
|
|
367
|
+
stdin.off("data", handleMouseData);
|
|
368
|
+
stdin.removeAllListeners("data");
|
|
369
|
+
};
|
|
370
|
+
}, [stdin, items, mouseEnabled, handleSelect]);
|
|
371
|
+
|
|
372
|
+
const handleResize = useCallback(() => {
|
|
373
|
+
setTerminalWidth(stdout.columns || 120);
|
|
374
|
+
}, [stdout.columns]);
|
|
375
|
+
|
|
376
|
+
useEffect(() => {
|
|
377
|
+
stdout.on("resize", handleResize);
|
|
378
|
+
return () => {
|
|
379
|
+
stdout.off("resize", handleResize);
|
|
380
|
+
};
|
|
381
|
+
}, [stdout, handleResize]);
|
|
382
|
+
|
|
383
|
+
useInput((input, key) => {
|
|
384
|
+
if (error) {
|
|
385
|
+
if (input === "r" || input === "R") {
|
|
386
|
+
setError(null);
|
|
387
|
+
setLoading(true);
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
if (input === "q" || key.escape) {
|
|
391
|
+
exit();
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
if (showHelp) {
|
|
398
|
+
setShowHelp(false);
|
|
399
|
+
return;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
if (isSearching) {
|
|
403
|
+
if (key.return) {
|
|
404
|
+
setIsSearching(false);
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
if (key.escape) {
|
|
408
|
+
setIsSearching(false);
|
|
409
|
+
setSearchQuery("");
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
if (key.backspace || key.delete) {
|
|
413
|
+
setSearchQuery((prev) => prev.slice(0, -1));
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
if (input && !key.ctrl && !key.meta) {
|
|
417
|
+
setSearchQuery((prev) => prev + input);
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
if (input === "q" && !key.ctrl && !key.meta) {
|
|
424
|
+
exit();
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
if (key.escape) {
|
|
429
|
+
if (selectedFile) {
|
|
430
|
+
setSelectedFile(null);
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
if (selectedService) {
|
|
434
|
+
setSelectedService(null);
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
if (selectedStack) {
|
|
438
|
+
setSelectedStack(null);
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
exit();
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
if (input === "?") {
|
|
446
|
+
setShowHelp(true);
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
if (input === "r") {
|
|
451
|
+
clearMetadataCache();
|
|
452
|
+
setMessage("Data refreshed");
|
|
453
|
+
setTimeout(() => setMessage(""), 1500);
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
if (input === "/") {
|
|
458
|
+
setIsSearching(true);
|
|
459
|
+
setSearchQuery("");
|
|
460
|
+
setMessage("Search: ");
|
|
461
|
+
return;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
if (input === "m") {
|
|
465
|
+
setMouseEnabled((prev) => {
|
|
466
|
+
const newState = !prev;
|
|
467
|
+
setMessage(newState ? "Mouse support enabled" : "Mouse support disabled");
|
|
468
|
+
return newState;
|
|
469
|
+
});
|
|
470
|
+
setTimeout(() => setMessage(""), 1500);
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
if (input === "t") {
|
|
475
|
+
setShowTooltips((prev) => {
|
|
476
|
+
const newState = !prev;
|
|
477
|
+
setMessage(newState ? "Tooltips enabled" : "Tooltips disabled");
|
|
478
|
+
return newState;
|
|
479
|
+
});
|
|
480
|
+
setTimeout(() => setMessage(""), 1500);
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
if (input === "e") {
|
|
485
|
+
setShowEnabledOnly((prev) => {
|
|
486
|
+
const newState = !prev;
|
|
487
|
+
setMessage(
|
|
488
|
+
newState ? "Showing enabled services only" : "Showing all services (including disabled)",
|
|
489
|
+
);
|
|
490
|
+
return newState;
|
|
491
|
+
});
|
|
492
|
+
setTimeout(() => setMessage(""), 1500);
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
if (key.tab) {
|
|
497
|
+
const tabs: TabId[] = ["overview", "resources", "events", "files", "config"];
|
|
498
|
+
const currentIdx = tabs.indexOf(activeTab);
|
|
499
|
+
const nextIdx = key.shift
|
|
500
|
+
? (currentIdx - 1 + tabs.length) % tabs.length
|
|
501
|
+
: (currentIdx + 1) % tabs.length;
|
|
502
|
+
setActiveTab(tabs[nextIdx]);
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
if (/^[1-5]$/.test(input)) {
|
|
507
|
+
const tabMap: Record<string, TabId> = {
|
|
508
|
+
"1": "overview",
|
|
509
|
+
"2": "resources",
|
|
510
|
+
"3": "events",
|
|
511
|
+
"4": "files",
|
|
512
|
+
"5": "config",
|
|
513
|
+
};
|
|
514
|
+
setActiveTab(tabMap[input]);
|
|
515
|
+
return;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
if (key.upArrow) {
|
|
519
|
+
setHighlightedIndex((prev) => (prev > 0 ? prev - 1 : items.length - 1));
|
|
520
|
+
}
|
|
521
|
+
if (key.downArrow) {
|
|
522
|
+
setHighlightedIndex((prev) => (prev < items.length - 1 ? prev + 1 : 0));
|
|
523
|
+
}
|
|
524
|
+
if (key.return || input === " ") {
|
|
525
|
+
const currentItem = items[highlightedIndex];
|
|
526
|
+
if (currentItem) {
|
|
527
|
+
handleSelect(currentItem);
|
|
528
|
+
}
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
const fileTreeNodes: FileNode[] = useMemo(() => {
|
|
534
|
+
if (selectedServiceData) {
|
|
535
|
+
return [
|
|
536
|
+
{
|
|
537
|
+
name: selectedServiceData.service.name,
|
|
538
|
+
path: selectedServiceData.service.path,
|
|
539
|
+
type: "directory",
|
|
540
|
+
children: selectedServiceData.metadata.autogeneratedFiles.map((f) => ({
|
|
541
|
+
name: f.name,
|
|
542
|
+
path: f.path,
|
|
543
|
+
type: "file",
|
|
544
|
+
fileType: f.type,
|
|
545
|
+
size: f.size,
|
|
546
|
+
lastModified: f.lastModified,
|
|
547
|
+
})),
|
|
548
|
+
},
|
|
549
|
+
];
|
|
550
|
+
}
|
|
551
|
+
return services.map((s: DiscoveredResource) => ({
|
|
552
|
+
name: s.name,
|
|
553
|
+
path: s.path,
|
|
554
|
+
type: "directory",
|
|
555
|
+
children: [],
|
|
556
|
+
}));
|
|
557
|
+
}, [selectedServiceData, services]);
|
|
558
|
+
|
|
559
|
+
const showSidebar = terminalWidth > 100;
|
|
560
|
+
const compactTabBar = terminalWidth < 100;
|
|
561
|
+
const compact = terminalWidth < 80;
|
|
562
|
+
|
|
563
|
+
if (loading) {
|
|
564
|
+
return <LoadingScreen progress={100} message="Initializing..." />;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
if (error) {
|
|
568
|
+
return (
|
|
569
|
+
<ErrorScreen
|
|
570
|
+
error={error}
|
|
571
|
+
onRetry={() => {
|
|
572
|
+
setError(null);
|
|
573
|
+
setLoading(true);
|
|
574
|
+
}}
|
|
575
|
+
/>
|
|
576
|
+
);
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
if (services.length === 0) {
|
|
580
|
+
return <EmptyState />;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
return (
|
|
584
|
+
<Box flexDirection="column" height={stdout.rows || 24}>
|
|
585
|
+
<Box paddingX={1} paddingY={0}>
|
|
586
|
+
<Text>
|
|
587
|
+
<Text color="cyan" bold>
|
|
588
|
+
▓▒░ TDK NEON EDITION ░▒▓
|
|
589
|
+
</Text>
|
|
590
|
+
<Text color="gray"> │ </Text>
|
|
591
|
+
<Text color="white">{projectRoot}</Text>
|
|
592
|
+
<Text color="gray"> │ </Text>
|
|
593
|
+
<Text color="green">{services.length} services ready</Text>
|
|
594
|
+
</Text>
|
|
595
|
+
</Box>
|
|
596
|
+
|
|
597
|
+
<Box paddingX={1}>
|
|
598
|
+
<Text color="gray">{"─".repeat(compact ? 60 : Math.min(terminalWidth - 4, 100))}</Text>
|
|
599
|
+
</Box>
|
|
600
|
+
|
|
601
|
+
{isSearching && (
|
|
602
|
+
<Box paddingX={1} height={1}>
|
|
603
|
+
<Text color="yellow">Search: {searchQuery}_</Text>
|
|
604
|
+
</Box>
|
|
605
|
+
)}
|
|
606
|
+
|
|
607
|
+
{!isSearching && message && (
|
|
608
|
+
<Box paddingX={1} height={1}>
|
|
609
|
+
<Text color="cyan">▓▒░ {message} ░▒▓</Text>
|
|
610
|
+
</Box>
|
|
611
|
+
)}
|
|
612
|
+
|
|
613
|
+
{!isSearching && !message && showTooltips && !showHelp && (
|
|
614
|
+
<Box paddingX={1} height={1}>
|
|
615
|
+
<Text color="gray" dimColor>
|
|
616
|
+
{activeTab === "overview" && selectedStack
|
|
617
|
+
? `Stack "${selectedStack}" selected. [Enter] view │ [Esc] back │ [e] ${showEnabledOnly ? "show all" : "enabled only"} │ [?] help`
|
|
618
|
+
: activeTab === "overview" && !selectedStack
|
|
619
|
+
? `[↑/↓] Navigate │ [Enter] Select │ [a] Pre-alpha │ [e] ${showEnabledOnly ? "show all" : "enabled only"} │ [?] help`
|
|
620
|
+
: activeTab === "resources"
|
|
621
|
+
? `[Tab] Tabs │ [r] Refresh │ [/] Search │ [e] ${showEnabledOnly ? "show all" : "enabled only"} │ [?] help`
|
|
622
|
+
: activeTab === "events"
|
|
623
|
+
? `Event timeline │ [Tab] Switch tabs │ [e] ${showEnabledOnly ? "show all" : "enabled only"} │ [?] help`
|
|
624
|
+
: activeTab === "files" && selectedService
|
|
625
|
+
? `Service "${selectedService}" │ [Space] Expand │ [Esc] Back │ [e] ${showEnabledOnly ? "show all" : "enabled only"} │ [?] help`
|
|
626
|
+
: activeTab === "files"
|
|
627
|
+
? `Select service to view files │ [e] ${showEnabledOnly ? "show all" : "enabled only"} │ [?] help`
|
|
628
|
+
: activeTab === "config"
|
|
629
|
+
? `View configurations │ [e] ${showEnabledOnly ? "show all" : "enabled only"} │ [?] help`
|
|
630
|
+
: `[Tab] Next │ [1-5] Tabs │ [e] ${showEnabledOnly ? "show all" : "enabled only"} │ [?] help │ [q] Quit`}
|
|
631
|
+
</Text>
|
|
632
|
+
</Box>
|
|
633
|
+
)}
|
|
634
|
+
|
|
635
|
+
{showHelp && (
|
|
636
|
+
<Box paddingX={1} flexGrow={1}>
|
|
637
|
+
<HelpPanel onClose={() => setShowHelp(false)} />
|
|
638
|
+
</Box>
|
|
639
|
+
)}
|
|
640
|
+
|
|
641
|
+
{!showHelp && (
|
|
642
|
+
<>
|
|
643
|
+
<Box marginTop={1}>
|
|
644
|
+
<TabBar activeTab={activeTab} onTabChange={setActiveTab} compact={compactTabBar} />
|
|
645
|
+
</Box>
|
|
646
|
+
|
|
647
|
+
<Box flexDirection="row" paddingX={1} flexGrow={1}>
|
|
648
|
+
<Box
|
|
649
|
+
flexDirection="column"
|
|
650
|
+
flexGrow={1}
|
|
651
|
+
width={showSidebar ? terminalWidth - 45 : terminalWidth - 4}
|
|
652
|
+
>
|
|
653
|
+
{activeTab === "overview" && (
|
|
654
|
+
<>
|
|
655
|
+
<Box marginBottom={1}>
|
|
656
|
+
<Text bold color="gray">
|
|
657
|
+
┌─ Stacks ─
|
|
658
|
+
</Text>
|
|
659
|
+
</Box>
|
|
660
|
+
<Box marginTop={1} flexGrow={1}>
|
|
661
|
+
<ResourceSelectInput
|
|
662
|
+
items={items}
|
|
663
|
+
onSelect={handleSelect}
|
|
664
|
+
highlightedIndex={highlightedIndex}
|
|
665
|
+
/>
|
|
666
|
+
</Box>
|
|
667
|
+
</>
|
|
668
|
+
)}
|
|
669
|
+
|
|
670
|
+
{activeTab === "resources" && (
|
|
671
|
+
<>
|
|
672
|
+
<Box marginBottom={1}>
|
|
673
|
+
<Text bold color="gray">
|
|
674
|
+
┌─ Resources ─
|
|
675
|
+
</Text>
|
|
676
|
+
</Box>
|
|
677
|
+
{selectedStackData ? (
|
|
678
|
+
<>
|
|
679
|
+
<Text color="gray">Stack: {selectedStackData.stack.name}</Text>
|
|
680
|
+
<Box marginTop={1}>
|
|
681
|
+
<ResourceTable
|
|
682
|
+
resources={selectedStackData.metadata.resources}
|
|
683
|
+
maxWidth={terminalWidth - (showSidebar ? 50 : 10)}
|
|
684
|
+
/>
|
|
685
|
+
</Box>
|
|
686
|
+
</>
|
|
687
|
+
) : (
|
|
688
|
+
<>
|
|
689
|
+
<Text color="gray">Select a stack to view resources</Text>
|
|
690
|
+
<Box marginTop={1}>
|
|
691
|
+
<ResourceSelectInput
|
|
692
|
+
items={items}
|
|
693
|
+
onSelect={handleSelect}
|
|
694
|
+
highlightedIndex={highlightedIndex}
|
|
695
|
+
/>
|
|
696
|
+
</Box>
|
|
697
|
+
</>
|
|
698
|
+
)}
|
|
699
|
+
</>
|
|
700
|
+
)}
|
|
701
|
+
|
|
702
|
+
{activeTab === "events" && (
|
|
703
|
+
<>
|
|
704
|
+
<Box marginBottom={1}>
|
|
705
|
+
<Text bold color="gray">
|
|
706
|
+
┌─ Events ─
|
|
707
|
+
</Text>
|
|
708
|
+
</Box>
|
|
709
|
+
<Box marginTop={1}>
|
|
710
|
+
<Text color="gray">Events tab not yet implemented</Text>
|
|
711
|
+
</Box>
|
|
712
|
+
</>
|
|
713
|
+
)}
|
|
714
|
+
|
|
715
|
+
{activeTab === "files" && (
|
|
716
|
+
<>
|
|
717
|
+
<Box marginBottom={1}>
|
|
718
|
+
<Text bold color="gray">
|
|
719
|
+
┌─ Autogenerated Files ─
|
|
720
|
+
</Text>
|
|
721
|
+
</Box>
|
|
722
|
+
{selectedServiceData ? (
|
|
723
|
+
<>
|
|
724
|
+
<Text color="gray">Service: {selectedServiceData.service.name}</Text>
|
|
725
|
+
<Box marginTop={1}>
|
|
726
|
+
<FileTree nodes={fileTreeNodes} selectedPath={selectedFile || undefined} />
|
|
727
|
+
</Box>
|
|
728
|
+
</>
|
|
729
|
+
) : (
|
|
730
|
+
<>
|
|
731
|
+
<Text color="gray">Select a service to view files</Text>
|
|
732
|
+
<Box marginTop={1}>
|
|
733
|
+
<ResourceSelectInput
|
|
734
|
+
items={items}
|
|
735
|
+
onSelect={handleSelect}
|
|
736
|
+
highlightedIndex={highlightedIndex}
|
|
737
|
+
/>
|
|
738
|
+
</Box>
|
|
739
|
+
</>
|
|
740
|
+
)}
|
|
741
|
+
</>
|
|
742
|
+
)}
|
|
743
|
+
|
|
744
|
+
{activeTab === "config" && (
|
|
745
|
+
<>
|
|
746
|
+
<Box marginBottom={1}>
|
|
747
|
+
<Text bold color="gray">
|
|
748
|
+
┌─ Configuration ─
|
|
749
|
+
</Text>
|
|
750
|
+
</Box>
|
|
751
|
+
{selectedServiceData ? (
|
|
752
|
+
<Box marginTop={1} flexDirection="column">
|
|
753
|
+
<Text color="cyan">{selectedServiceData.service.configPath}</Text>
|
|
754
|
+
<Box marginTop={1} borderStyle="single" borderColor="gray" paddingX={1}>
|
|
755
|
+
<Text color="gray" wrap="wrap">
|
|
756
|
+
{JSON.stringify(selectedServiceData.service.config, null, 2).slice(
|
|
757
|
+
0,
|
|
758
|
+
1000,
|
|
759
|
+
)}
|
|
760
|
+
</Text>
|
|
761
|
+
</Box>
|
|
762
|
+
</Box>
|
|
763
|
+
) : (
|
|
764
|
+
<>
|
|
765
|
+
<Text color="gray">Select a service to view configuration</Text>
|
|
766
|
+
<Box marginTop={1}>
|
|
767
|
+
<ResourceSelectInput
|
|
768
|
+
items={items}
|
|
769
|
+
onSelect={handleSelect}
|
|
770
|
+
highlightedIndex={highlightedIndex}
|
|
771
|
+
/>
|
|
772
|
+
</Box>
|
|
773
|
+
</>
|
|
774
|
+
)}
|
|
775
|
+
</>
|
|
776
|
+
)}
|
|
777
|
+
</Box>
|
|
778
|
+
|
|
779
|
+
{showSidebar && (
|
|
780
|
+
<Box marginLeft={2}>
|
|
781
|
+
<DetailPanel
|
|
782
|
+
stack={selectedStackData?.stack || null}
|
|
783
|
+
service={selectedServiceData?.service || null}
|
|
784
|
+
stackMetadata={selectedStackData?.metadata || null}
|
|
785
|
+
visible={!!selectedStack || !!selectedService}
|
|
786
|
+
/>
|
|
787
|
+
</Box>
|
|
788
|
+
)}
|
|
789
|
+
</Box>
|
|
790
|
+
|
|
791
|
+
<Box
|
|
792
|
+
borderStyle="single"
|
|
793
|
+
borderColor="gray"
|
|
794
|
+
paddingX={1}
|
|
795
|
+
height={3}
|
|
796
|
+
flexDirection="column"
|
|
797
|
+
marginTop={1}
|
|
798
|
+
>
|
|
799
|
+
<Box justifyContent="space-between">
|
|
800
|
+
<Text color="cyan" bold>
|
|
801
|
+
▓▒░ {activeTab}
|
|
802
|
+
</Text>
|
|
803
|
+
<Text color="green">
|
|
804
|
+
● {services.filter((s: DiscoveredResource) => s.stack).length} in stack
|
|
805
|
+
</Text>
|
|
806
|
+
<Text color="yellow">
|
|
807
|
+
○ {services.filter((s: DiscoveredResource) => !s.stack).length} no stack
|
|
808
|
+
</Text>
|
|
809
|
+
</Box>
|
|
810
|
+
<Box justifyContent="space-between">
|
|
811
|
+
<Text color="gray">Stacks: {stacks.length}</Text>
|
|
812
|
+
<Text color="gray">Services: {services.length}</Text>
|
|
813
|
+
<Text color="gray">
|
|
814
|
+
🖱️ {mouseEnabled ? "ON" : "OFF"} │ ℹ️ {showTooltips ? "ON" : "OFF"} │
|
|
815
|
+
<Text color={showEnabledOnly ? "green" : "yellow"}>
|
|
816
|
+
{showEnabledOnly ? "✓ enabled" : "✓ all"}
|
|
817
|
+
</Text>
|
|
818
|
+
{" │ "}
|
|
819
|
+
[?] Help │ [q] Quit
|
|
820
|
+
</Text>
|
|
821
|
+
</Box>
|
|
822
|
+
</Box>
|
|
823
|
+
</>
|
|
824
|
+
)}
|
|
825
|
+
</Box>
|
|
826
|
+
);
|
|
827
|
+
};
|
|
828
|
+
|
|
829
|
+
export const uiCommand = new Command("ui")
|
|
830
|
+
.description("Interactive TUI for managing stacks and services (Neon Edition)")
|
|
831
|
+
.alias("interactive")
|
|
832
|
+
.option("-v, --verbose", "Enable verbose output", false)
|
|
833
|
+
.option("--no-animations", "Disable animations")
|
|
834
|
+
.option("--high-contrast", "Enable high contrast mode")
|
|
835
|
+
.action(async () => {
|
|
836
|
+
const tiltAvailable = await isTiltAvailable();
|
|
837
|
+
if (!tiltAvailable) {
|
|
838
|
+
errorFactories.tiltNotInstalled().exit();
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
requireProjectRoot();
|
|
842
|
+
render(<TUIApp />);
|
|
843
|
+
});
|