@tdk-landscape/tdk-cli-core 1.3.139 → 1.3.141

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 (159) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/cli/dist/backend-frameworks/elysia.js +0 -1
  3. package/cli/dist/backend-frameworks/express.js +0 -1
  4. package/cli/dist/backend-frameworks/fastify.js +0 -1
  5. package/cli/dist/backend-frameworks/h3.js +0 -1
  6. package/cli/dist/backend-frameworks/koa.js +0 -1
  7. package/cli/dist/backend-frameworks/mcp.js +0 -1
  8. package/cli/dist/backend-frameworks/nestjs.js +0 -1
  9. package/cli/dist/backend-frameworks/registry.js +0 -1
  10. package/cli/dist/backend-frameworks/types.js +0 -1
  11. package/cli/dist/backend-languages/bun.js +0 -1
  12. package/cli/dist/backend-languages/go.js +0 -1
  13. package/cli/dist/backend-languages/python.js +0 -1
  14. package/cli/dist/backend-languages/registry.js +0 -1
  15. package/cli/dist/backend-languages/rust.js +0 -1
  16. package/cli/dist/backend-languages/types.js +0 -1
  17. package/cli/dist/cli.js +0 -1
  18. package/cli/dist/commands/__tests__/project-e2e-helpers.js +0 -1
  19. package/cli/dist/commands/completion.js +0 -1
  20. package/cli/dist/commands/config.js +3 -14
  21. package/cli/dist/commands/doctor.js +10 -11
  22. package/cli/dist/commands/down.js +0 -1
  23. package/cli/dist/commands/eject.js +0 -1
  24. package/cli/dist/commands/help.js +0 -1
  25. package/cli/dist/commands/import.js +0 -1
  26. package/cli/dist/commands/logs.js +0 -1
  27. package/cli/dist/commands/maintainers.js +0 -1
  28. package/cli/dist/commands/mcp.js +0 -1
  29. package/cli/dist/commands/networks.js +0 -2
  30. package/cli/dist/commands/project.js +3 -4
  31. package/cli/dist/commands/projects.js +0 -1
  32. package/cli/dist/commands/resource.js +8 -9
  33. package/cli/dist/commands/resources.js +0 -1
  34. package/cli/dist/commands/runtime.js +0 -1
  35. package/cli/dist/commands/stack.js +0 -1
  36. package/cli/dist/commands/stacks.js +0 -1
  37. package/cli/dist/commands/status.js +0 -1
  38. package/cli/dist/commands/ui.js +8 -13
  39. package/cli/dist/commands/up.js +6 -7
  40. package/cli/dist/commands/upgrade.js +2 -2
  41. package/cli/dist/commands/version.js +0 -1
  42. package/cli/dist/components/Accessible.js +4 -3
  43. package/cli/dist/components/BaseTooltip.js +0 -1
  44. package/cli/dist/components/DetailPanel.js +0 -1
  45. package/cli/dist/components/FileTree.js +0 -1
  46. package/cli/dist/components/ResourceSelectInput.js +3 -3
  47. package/cli/dist/components/ResourceTable.js +0 -1
  48. package/cli/dist/components/ServiceIssues.js +0 -1
  49. package/cli/dist/components/TUIHeader.js +0 -1
  50. package/cli/dist/components/TabBar.js +0 -1
  51. package/cli/dist/components/Tooltip.js +0 -1
  52. package/cli/dist/components/index.js +0 -1
  53. package/cli/dist/components/ui-theme.js +5 -1
  54. package/cli/dist/config/platform-standards.js +0 -1
  55. package/cli/dist/frontend-frameworks/lit.js +0 -1
  56. package/cli/dist/frontend-frameworks/preact.js +0 -1
  57. package/cli/dist/frontend-frameworks/qwik.js +0 -1
  58. package/cli/dist/frontend-frameworks/react.js +0 -1
  59. package/cli/dist/frontend-frameworks/registry.js +0 -1
  60. package/cli/dist/frontend-frameworks/solid.js +0 -1
  61. package/cli/dist/frontend-frameworks/svelte.js +0 -1
  62. package/cli/dist/frontend-frameworks/tanstack-router.js +0 -1
  63. package/cli/dist/frontend-frameworks/types.js +0 -1
  64. package/cli/dist/frontend-frameworks/vanilla.js +0 -1
  65. package/cli/dist/frontend-frameworks/vue.js +0 -1
  66. package/cli/dist/generator/__tests__/golden-helpers.js +0 -1
  67. package/cli/dist/generator/extension-fetch.js +0 -1
  68. package/cli/dist/generator/resource-templates.js +0 -1
  69. package/cli/dist/generator/template-engine.js +9 -10
  70. package/cli/dist/index.js +0 -1
  71. package/cli/dist/mcp/server.js +0 -1
  72. package/cli/dist/mcp/tools.js +33 -14
  73. package/cli/dist/types/index.js +4 -6
  74. package/cli/dist/utils/agent-host.js +0 -1
  75. package/cli/dist/utils/atomic-write.js +0 -1
  76. package/cli/dist/utils/bun-floor.js +0 -1
  77. package/cli/dist/utils/bun-requirement.js +0 -1
  78. package/cli/dist/utils/cache.js +0 -1
  79. package/cli/dist/utils/cold-preflight.js +2 -2
  80. package/cli/dist/utils/command-helpers.js +0 -1
  81. package/cli/dist/utils/constants.js +18 -4
  82. package/cli/dist/utils/discovery-context.js +0 -1
  83. package/cli/dist/utils/discovery-paths.js +2 -2
  84. package/cli/dist/utils/docker.js +0 -1
  85. package/cli/dist/utils/doctor-report.js +0 -1
  86. package/cli/dist/utils/doctor-runtime.js +4 -5
  87. package/cli/dist/utils/doctor-starlark.js +0 -1
  88. package/cli/dist/utils/doctor-wiring.js +8 -9
  89. package/cli/dist/utils/down-cleanup.js +0 -1
  90. package/cli/dist/utils/env-validator.js +0 -1
  91. package/cli/dist/utils/errors.js +2 -3
  92. package/cli/dist/utils/exec-async.js +0 -1
  93. package/cli/dist/utils/file-helpers.js +1 -3
  94. package/cli/dist/utils/formatting.js +0 -1
  95. package/cli/dist/utils/generated-paths.js +5 -6
  96. package/cli/dist/utils/help-command.js +0 -1
  97. package/cli/dist/utils/host-port-config.js +2 -2
  98. package/cli/dist/utils/host-port-plan.js +0 -1
  99. package/cli/dist/utils/json-output.js +0 -1
  100. package/cli/dist/utils/machine-output.js +0 -1
  101. package/cli/dist/utils/paths.js +2 -2
  102. package/cli/dist/utils/platform.js +0 -1
  103. package/cli/dist/utils/port-assignment.js +0 -1
  104. package/cli/dist/utils/port-conflict-fix.js +0 -1
  105. package/cli/dist/utils/port-fallback-notice.js +0 -1
  106. package/cli/dist/utils/port-listener-probe.js +0 -1
  107. package/cli/dist/utils/project-config-defaults.js +0 -1
  108. package/cli/dist/utils/project-features.js +0 -1
  109. package/cli/dist/utils/project-templates.js +0 -1
  110. package/cli/dist/utils/prompt.js +0 -1
  111. package/cli/dist/utils/resource-features.js +0 -1
  112. package/cli/dist/utils/resource-kind.js +0 -1
  113. package/cli/dist/utils/schema-version-gate.js +0 -1
  114. package/cli/dist/utils/search-status.js +0 -1
  115. package/cli/dist/utils/secret-redaction.js +0 -1
  116. package/cli/dist/utils/service-config-checks.js +0 -1
  117. package/cli/dist/utils/service-manifest.js +0 -1
  118. package/cli/dist/utils/service-runtime-state.js +0 -1
  119. package/cli/dist/utils/service-urls.js +2 -2
  120. package/cli/dist/utils/services.js +3 -6
  121. package/cli/dist/utils/shared-platform-postgres.js +2 -3
  122. package/cli/dist/utils/single-flight.js +0 -1
  123. package/cli/dist/utils/smoke.js +2 -1
  124. package/cli/dist/utils/spinner.js +0 -1
  125. package/cli/dist/utils/stack-features.js +0 -1
  126. package/cli/dist/utils/stack-status.js +0 -1
  127. package/cli/dist/utils/startup-report.js +0 -1
  128. package/cli/dist/utils/status-message.js +0 -1
  129. package/cli/dist/utils/status-ports.js +0 -1
  130. package/cli/dist/utils/suggestions.js +6 -3
  131. package/cli/dist/utils/tar.js +5 -4
  132. package/cli/dist/utils/tdk-version.js +2 -2
  133. package/cli/dist/utils/terminal-layout.js +0 -1
  134. package/cli/dist/utils/tilt-events.js +0 -1
  135. package/cli/dist/utils/tilt-logs.js +0 -1
  136. package/cli/dist/utils/tilt-process.js +0 -1
  137. package/cli/dist/utils/tilt-resource-state.js +0 -1
  138. package/cli/dist/utils/tilt-startup.js +0 -1
  139. package/cli/dist/utils/tilt-unreachable-message.js +0 -1
  140. package/cli/dist/utils/tilt.js +0 -1
  141. package/cli/dist/utils/ui-keymap.js +1 -2
  142. package/cli/dist/utils/ui-service-state.js +0 -1
  143. package/cli/dist/utils/up-only.js +0 -1
  144. package/cli/dist/utils/up-readiness.js +0 -1
  145. package/cli/dist/utils/validation.js +0 -1
  146. package/cli/dist/utils/which.js +0 -1
  147. package/cli/dist/utils/windows-doctor.js +0 -1
  148. package/cli/dist-bundle/chunk-42IVF3YT.js +3 -0
  149. package/cli/dist-bundle/chunk-CJ3L25OH.js +315 -0
  150. package/cli/dist-bundle/cli.js +211 -211
  151. package/cli/dist-bundle/{cold-preflight-LV5MPGEA.js → cold-preflight-KLI6R3XF.js} +1 -1
  152. package/cli/dist-bundle/{extension-fetch-COIG2KR6.js → extension-fetch-6XNTDF44.js} +1 -1
  153. package/cli/package.json +1 -1
  154. package/engine/topologies/platform/docker/AGENTS.md +13 -13
  155. package/engine/topologies/platform/docker/dockerfile/language_dockerfile.star +6 -2
  156. package/engine/topologies/tilt/manifest/README.md +1 -15
  157. package/package.json +1 -1
  158. package/cli/dist-bundle/chunk-7IDEZ54B.js +0 -315
  159. package/cli/dist-bundle/chunk-OBQS5CYC.js +0 -3
@@ -4,7 +4,7 @@ import { execFileSync, execSync } from "node:child_process";
4
4
  import { existsSync, readdirSync, readFileSync } from "node:fs";
5
5
  import { basename, dirname, join, relative } from "node:path";
6
6
  import { BACKEND_LANGUAGES } from "../backend-languages/registry.js";
7
- import { BRING_YOUR_OWN_TYPE, DATABASE_MANAGEMENT_FEATURE } from "./constants.js";
7
+ import { AUTOGENERATED_DIR, BRING_YOUR_OWN_TYPE, DATABASE_MANAGEMENT_FEATURE, DOCKER_COMPOSE_FILE, PACKAGE_JSON, PROJECT_JSON, } from "./constants.js";
8
8
  import { execAsync } from "./exec-async.js";
9
9
  import { formatCount } from "./formatting.js";
10
10
  import { findProjectRoot } from "./paths.js";
@@ -21,10 +21,10 @@ const EXEC_TIMEOUT_MS = 10_000;
21
21
  const SOURCE_EXTENSIONS = /\.(?:[cm]?[jt]sx?|vue)$/;
22
22
  const TEST_FILE = /(?:\.test\.|\.spec\.|\/tests?\/|\/__tests__\/)/;
23
23
  const PRISMA_MAJOR = 7;
24
- const SKIPPED_DIRS = new Set(["node_modules", ".autogenerated", "dist", "tests", "__tests__"]);
24
+ const SKIPPED_DIRS = new Set(["node_modules", AUTOGENERATED_DIR, "dist", "tests", "__tests__"]);
25
25
  function projectName(projectRoot) {
26
26
  try {
27
- const parsed = JSON.parse(readFileSync(join(projectRoot, ".tdk", "project.json"), "utf-8"));
27
+ const parsed = JSON.parse(readFileSync(join(projectRoot, ".tdk", PROJECT_JSON), "utf-8"));
28
28
  return typeof parsed?.project?.name === "string" ? parsed.project.name : undefined;
29
29
  }
30
30
  catch {
@@ -42,7 +42,7 @@ function readParams(configPath) {
42
42
  }
43
43
  function packageJson(resourcePath) {
44
44
  try {
45
- const value = JSON.parse(readFileSync(join(resourcePath, "package.json"), "utf-8"));
45
+ const value = JSON.parse(readFileSync(join(resourcePath, PACKAGE_JSON), "utf-8"));
46
46
  return value && typeof value === "object" ? value : {};
47
47
  }
48
48
  catch {
@@ -69,7 +69,7 @@ function prismaSchemaFindings(path) {
69
69
  return findings;
70
70
  }
71
71
  function prismaConfigFindings(resourcePath) {
72
- const generated = join(resourcePath, ".autogenerated", "prisma.config.autogenerated.ts");
72
+ const generated = join(resourcePath, AUTOGENERATED_DIR, "prisma.config.autogenerated.ts");
73
73
  const candidates = [join(resourcePath, "prisma.config.ts"), generated];
74
74
  const path = candidates.find((candidate) => existsSync(candidate));
75
75
  if (!path)
@@ -189,7 +189,7 @@ export function checkResourcePackageJson(projectRoot = findProjectRoot() ?? proc
189
189
  const missing = discoverResourcesFromRoot(projectRoot)
190
190
  .filter((resource) => !isBringYourOwn(resource) &&
191
191
  !ownsRuntimeFiles(resource) &&
192
- !existsSync(join(resource.path, "package.json")))
192
+ !existsSync(join(resource.path, PACKAGE_JSON)))
193
193
  .map((resource) => resource.name);
194
194
  if (missing.length === 0) {
195
195
  return {
@@ -441,7 +441,7 @@ function readText(path) {
441
441
  }
442
442
  }
443
443
  function startScriptMigrations(resourceDir) {
444
- const text = readText(join(resourceDir, "package.json"));
444
+ const text = readText(join(resourceDir, PACKAGE_JSON));
445
445
  if (text === undefined)
446
446
  return [];
447
447
  let scripts = {};
@@ -527,7 +527,7 @@ export function checkNatsBroker(projectRoot = findProjectRoot() ?? process.cwd()
527
527
  isSkipped: true,
528
528
  };
529
529
  }
530
- if (existsSync(join(projectRoot, "services", "platform", "messaging", "docker-compose.yml"))) {
530
+ if (existsSync(join(projectRoot, "services", "platform", "messaging", DOCKER_COMPOSE_FILE))) {
531
531
  return {
532
532
  name: "NATS broker",
533
533
  didPass: true,
@@ -695,4 +695,3 @@ export async function checkDockerNetworkCapacity(exec = execAsync) {
695
695
  }
696
696
  return { name: "Docker networks", didPass: true, message: "Docker can create networks" };
697
697
  }
698
- //# sourceMappingURL=doctor-wiring.js.map
@@ -97,4 +97,3 @@ export async function waitForTiltUpExit(tiltfilePath, timeoutMs = 8000, findPids
97
97
  }
98
98
  return true;
99
99
  }
100
- //# sourceMappingURL=down-cleanup.js.map
@@ -264,4 +264,3 @@ export function ensureEnvFile(projectRoot) {
264
264
  }
265
265
  return false;
266
266
  }
267
- //# sourceMappingURL=env-validator.js.map
@@ -149,13 +149,12 @@ function showError(message, context, suggestions) {
149
149
  }
150
150
  if (suggestions && suggestions.length > 0) {
151
151
  console.error(chalk.yellow("\n💡 Suggestions:"));
152
- suggestions.forEach((s) => {
152
+ for (const s of suggestions) {
153
153
  console.error(chalk.cyan(` → ${s}`));
154
- });
154
+ }
155
155
  }
156
156
  }
157
157
  export function handleTiltFailure(command, exitCode) {
158
158
  console.error(chalk.red(`\ntilt ${command} failed with exit code ${exitCode}`));
159
159
  process.exit(exitCode);
160
160
  }
161
- //# sourceMappingURL=errors.js.map
@@ -29,4 +29,3 @@ export function isExecTimeout(err) {
29
29
  const e = err;
30
30
  return e?.code === "ETIMEDOUT" || e?.killed === true;
31
31
  }
32
- //# sourceMappingURL=exec-async.js.map
@@ -4,8 +4,7 @@ import { appendFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } fr
4
4
  import { resolve } from "node:path";
5
5
  import chalk from "chalk";
6
6
  export function writeFilesWithProgress(basePath, tasks, onProgress) {
7
- for (let i = 0; i < tasks.length; i++) {
8
- const task = tasks[i];
7
+ for (const [i, task] of tasks.entries()) {
9
8
  console.log(chalk.blue(`${task.emoji} ${task.description}...`));
10
9
  if (task.type === "json") {
11
10
  writeJsonFileInDir(basePath, task.filename, task.content);
@@ -71,4 +70,3 @@ export function ensureGitignore(projectRoot) {
71
70
  appendFileSync(gitignorePath, `${prefix}${header}${missing.join("\n")}\n`);
72
71
  return missing;
73
72
  }
74
- //# sourceMappingURL=file-helpers.js.map
@@ -163,4 +163,3 @@ export function printBoxedHeader(title, subtitle, width = DEFAULT_BOX_WIDTH) {
163
163
  }
164
164
  console.log(chalk.cyan(`╰${line}╯`));
165
165
  }
166
- //# sourceMappingURL=formatting.js.map
@@ -2,15 +2,15 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  import { existsSync, lstatSync } from "node:fs";
4
4
  import { isAbsolute, normalize, relative, sep } from "node:path";
5
- import { TILTIGNORE_FILE } from "./constants.js";
5
+ import { AUTOGENERATED_DIR, PACKAGE_JSON, TILTIGNORE_FILE } from "./constants.js";
6
6
  /** Reviewed TDK-owned destinations written by `tdk config regenerate` or Tilt generation. */
7
7
  export const TDK_GENERATED_PATH_ALLOWLIST = [
8
- ".autogenerated/**",
8
+ `${AUTOGENERATED_DIR}/**`,
9
9
  ".tdk/.tdk-out/**",
10
10
  "Tiltfile",
11
11
  "TILT_*.star",
12
12
  TILTIGNORE_FILE,
13
- "package.json (create only)",
13
+ `${PACKAGE_JSON} (create only)`,
14
14
  "shared-platform-engineering/docker-templates/**",
15
15
  "services/platform/database-management/docker-compose.yml",
16
16
  "product_autogenerated_resource_manifests/**",
@@ -20,7 +20,7 @@ export function isTdkGeneratedPath(path) {
20
20
  const normalized = normalize(path).split(sep).join("/");
21
21
  if (isAbsolute(path) || normalized === ".." || normalized.startsWith("../"))
22
22
  return false;
23
- if (normalized.split("/").includes(".autogenerated") ||
23
+ if (normalized.split("/").includes(AUTOGENERATED_DIR) ||
24
24
  normalized.startsWith(".tdk/.tdk-out/") ||
25
25
  normalized === "shared-platform-engineering/docker-templates" ||
26
26
  normalized.startsWith("shared-platform-engineering/docker-templates/") ||
@@ -31,7 +31,7 @@ export function isTdkGeneratedPath(path) {
31
31
  return (normalized === "Tiltfile" ||
32
32
  /^TILT_[^/]+\.star$/.test(normalized) ||
33
33
  normalized === TILTIGNORE_FILE ||
34
- normalized === "package.json" ||
34
+ normalized === PACKAGE_JSON ||
35
35
  normalized === "services/platform/database-management/docker-compose.yml");
36
36
  }
37
37
  export function assertTdkGeneratedPath(projectRoot, path) {
@@ -49,4 +49,3 @@ export function assertTdkGeneratedPath(projectRoot, path) {
49
49
  }
50
50
  return absolute;
51
51
  }
52
- //# sourceMappingURL=generated-paths.js.map
@@ -9,4 +9,3 @@ export function unknownHelpTarget(args, commands) {
9
9
  const known = commands.some((command) => command.name() === target || command.aliases().includes(target));
10
10
  return known ? undefined : target;
11
11
  }
12
- //# sourceMappingURL=help-command.js.map
@@ -3,6 +3,7 @@
3
3
  import { execFileSync } from "node:child_process";
4
4
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
5
5
  import { join } from "node:path";
6
+ import { PROJECT_JSON } from "./constants.js";
6
7
  import { createHostPortPlan, isHostPortAvailable } from "./host-port-plan.js";
7
8
  const CONFIG_PATH = join(".tdk", ".tdk-out", "host-ports.json");
8
9
  export function isDockerPortOwnedByProject(dockerPs, projectPrefix, port) {
@@ -56,7 +57,7 @@ export async function getHostPortPlan(projectRoot, options = {}) {
56
57
  return saved;
57
58
  let prefix = "";
58
59
  try {
59
- const project = JSON.parse(readFileSync(join(projectRoot, ".tdk", "project.json"), "utf-8"));
60
+ const project = JSON.parse(readFileSync(join(projectRoot, ".tdk", PROJECT_JSON), "utf-8"));
60
61
  prefix = String(project?.project?.name ?? "tdk-project")
61
62
  .replace(/-/g, "_")
62
63
  .toLowerCase();
@@ -87,4 +88,3 @@ export async function getHostPortPlan(projectRoot, options = {}) {
87
88
  }
88
89
  return createHostPortPlan({ isAvailable });
89
90
  }
90
- //# sourceMappingURL=host-port-config.js.map
@@ -76,4 +76,3 @@ export async function createHostPortPlan(options = {}) {
76
76
  export function formatHostPortPlan(plan) {
77
77
  return `Host ports: HTTP ${plan.ingressHttp}, HTTPS ${plan.ingressHttps}, Postgres ${plan.postgres}`;
78
78
  }
79
- //# sourceMappingURL=host-port-plan.js.map
@@ -26,4 +26,3 @@ export function createJsonEmitter(failureCode, command) {
26
26
  });
27
27
  return emit;
28
28
  }
29
- //# sourceMappingURL=json-output.js.map
@@ -30,4 +30,3 @@ export function writeMachineError(error) {
30
30
  console.error(result.error.message);
31
31
  process.exit(result.exitCode);
32
32
  }
33
- //# sourceMappingURL=machine-output.js.map
@@ -4,11 +4,12 @@ import { existsSync } from "node:fs";
4
4
  import { dirname, join, resolve } from "node:path";
5
5
  import { cwd } from "node:process";
6
6
  import packageJson from "../../package.json" with { type: "json" };
7
+ import { PROJECT_JSON } from "./constants.js";
7
8
  export function findProjectRoot(startDir = cwd()) {
8
9
  let currentDir = resolve(startDir);
9
10
  const root = resolve("/");
10
11
  while (currentDir !== root) {
11
- if (existsSync(join(currentDir, ".tdk", "project.json"))) {
12
+ if (existsSync(join(currentDir, ".tdk", PROJECT_JSON))) {
12
13
  return currentDir;
13
14
  }
14
15
  const parentDir = dirname(currentDir);
@@ -40,4 +41,3 @@ function getPackageInfo() {
40
41
  export function getPackageVersion() {
41
42
  return getPackageInfo().version;
42
43
  }
43
- //# sourceMappingURL=paths.js.map
@@ -52,4 +52,3 @@ export function pathLookups(binName, windows = isWindows()) {
52
52
  export function pathDelimiter(windows = isWindows()) {
53
53
  return windows ? ";" : delimiter;
54
54
  }
55
- //# sourceMappingURL=platform.js.map
@@ -73,4 +73,3 @@ export function assignPort(resourceType, existingResources) {
73
73
  }
74
74
  return assignedPort;
75
75
  }
76
- //# sourceMappingURL=port-assignment.js.map
@@ -23,4 +23,3 @@ export function portConflictFix(message) {
23
23
  return `Fix: stop the process using port ${port} (${find})`;
24
24
  return `Fix: stop the process using port ${port} (${find}), or set ${envVar} to a free port and run tdk up`;
25
25
  }
26
- //# sourceMappingURL=port-conflict-fix.js.map
@@ -15,4 +15,3 @@ export function formatPortFallbackNotice(plan) {
15
15
  }
16
16
  return lines;
17
17
  }
18
- //# sourceMappingURL=port-fallback-notice.js.map
@@ -18,4 +18,3 @@ export function hasLocalListener(port, timeoutMs = 500) {
18
18
  socket.once("error", () => finish(false));
19
19
  });
20
20
  }
21
- //# sourceMappingURL=port-listener-probe.js.map
@@ -15,4 +15,3 @@ import { DATABASE_MANAGEMENT_FEATURE } from "./constants.js";
15
15
  * the reverse). See shared-platform-postgres.ts.
16
16
  */
17
17
  export const DEFAULT_ALWAYS_ENABLED_INFRA = [DATABASE_MANAGEMENT_FEATURE, "proxy"];
18
- //# sourceMappingURL=project-config-defaults.js.map
@@ -89,4 +89,3 @@ export function getEnabledProjectFeatures(optional_infra) {
89
89
  }
90
90
  return enabled;
91
91
  }
92
- //# sourceMappingURL=project-features.js.map
@@ -26,4 +26,3 @@ export const PROJECT_TEMPLATES = {
26
26
  description: "Hono + Postgres + NATS worker + Vite example with a routed write path",
27
27
  },
28
28
  };
29
- //# sourceMappingURL=project-templates.js.map
@@ -83,4 +83,3 @@ export async function promptMultiSelect(options) {
83
83
  console.log(validation);
84
84
  }
85
85
  }
86
- //# sourceMappingURL=prompt.js.map
@@ -182,4 +182,3 @@ export function getDefaultFeaturesForResourceType(appType) {
182
182
  export function getGeneratorsForResourceType(appType) {
183
183
  return Object.values(RESOURCE_FEATURES).filter((f) => f.applies_to.includes(appType));
184
184
  }
185
- //# sourceMappingURL=resource-features.js.map
@@ -7,4 +7,3 @@
7
7
  export function isApiServiceType(appType) {
8
8
  return appType === "backend" || appType === "mcp";
9
9
  }
10
- //# sourceMappingURL=resource-kind.js.map
@@ -38,4 +38,3 @@ export function enforceSchemaVersionGate(projectRoot, options = {}, exit = proce
38
38
  console.error(chalk.gray(` Fix: ${fix}`));
39
39
  exit(1);
40
40
  }
41
- //# sourceMappingURL=schema-version-gate.js.map
@@ -10,4 +10,3 @@ export function describeSearch(query, matches, total) {
10
10
  }
11
11
  return { summary: `${matches} of ${total}` };
12
12
  }
13
- //# sourceMappingURL=search-status.js.map
@@ -54,4 +54,3 @@ export function redactValue(value, secrets) {
54
54
  }
55
55
  return value;
56
56
  }
57
- //# sourceMappingURL=secret-redaction.js.map
@@ -187,4 +187,3 @@ export function enforceServiceConfigGate(projectRoot, options = {}, exit = proce
187
187
  }
188
188
  exit(1);
189
189
  }
190
- //# sourceMappingURL=service-config-checks.js.map
@@ -251,4 +251,3 @@ export function validateServiceManifestFile(filePath, displayPath) {
251
251
  return { errors: [`${displayPath}: invalid JSON (${message})`], warnings: [] };
252
252
  }
253
253
  }
254
- //# sourceMappingURL=service-manifest.js.map
@@ -64,4 +64,3 @@ export function deriveServiceStates(jsonText, dependsOn, deferred = new Set()) {
64
64
  }
65
65
  return result;
66
66
  }
67
- //# sourceMappingURL=service-runtime-state.js.map
@@ -2,13 +2,14 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  import { readFileSync } from "node:fs";
4
4
  import { join } from "node:path";
5
+ import { PROJECT_JSON } from "./constants.js";
5
6
  import { findProjectRoot } from "./paths.js";
6
7
  import { isApiServiceType } from "./resource-kind.js";
7
8
  export function getProjectName() {
8
9
  const root = findProjectRoot();
9
10
  if (root) {
10
11
  try {
11
- const content = readFileSync(join(root, ".tdk", "project.json"), "utf-8");
12
+ const content = readFileSync(join(root, ".tdk", PROJECT_JSON), "utf-8");
12
13
  const parsed = JSON.parse(content);
13
14
  if (parsed?.project?.name) {
14
15
  return parsed.project.name;
@@ -95,4 +96,3 @@ export async function pingHealthTarget(target, timeoutMs) {
95
96
  export async function pingHealthTargets(targets, timeoutMs) {
96
97
  return Promise.all(targets.map((target) => pingHealthTarget(target, timeoutMs)));
97
98
  }
98
- //# sourceMappingURL=service-urls.js.map
@@ -3,7 +3,7 @@
3
3
  import { existsSync, readdirSync, readFileSync, statSync } from "node:fs";
4
4
  import { dirname, join } from "node:path";
5
5
  import { Cache, createCacheValidator } from "./cache.js";
6
- import { AUTOGENERATED_FILE_PATTERNS, SERVICE_JSON, SKIP_DIRECTORIES } from "./constants.js";
6
+ import { AUTOGENERATED_FILE_PATTERNS, DOCKER_COMPOSE_FILE, PACKAGE_JSON, SERVICE_JSON, SKIP_DIRECTORIES, } from "./constants.js";
7
7
  import { errorFactories } from "./errors.js";
8
8
  import { formatCount } from "./formatting.js";
9
9
  import { findProjectRoot } from "./paths.js";
@@ -240,9 +240,7 @@ function detectFileType(filename, content) {
240
240
  if (filename === "Tiltfile" || filename.endsWith(".star")) {
241
241
  return "tilt";
242
242
  }
243
- if (filename === "vite.config.ts" ||
244
- filename === "tsconfig.json" ||
245
- filename === "package.json") {
243
+ if (filename === "vite.config.ts" || filename === "tsconfig.json" || filename === PACKAGE_JSON) {
246
244
  return "config";
247
245
  }
248
246
  if (filename === "schema.prisma" || filename.includes("migration")) {
@@ -271,7 +269,7 @@ export function getResourceMetadata(resource) {
271
269
  const autogeneratedFiles = discoverAutogeneratedFiles(resourceDir);
272
270
  const hasDockerfile = existsSync(join(resourceDir, "Dockerfile"));
273
271
  const hasTiltfile = existsSync(join(resourceDir, "Tiltfile"));
274
- const hasDockerCompose = existsSync(join(resourceDir, "docker-compose.yml")) ||
272
+ const hasDockerCompose = existsSync(join(resourceDir, DOCKER_COMPOSE_FILE)) ||
275
273
  existsSync(join(resourceDir, "docker-compose.yaml"));
276
274
  const configType = resource.config?.appType;
277
275
  let type = configType || "backend";
@@ -363,4 +361,3 @@ export function getStackMetadata(stack) {
363
361
  cacheValidator.markUpdated();
364
362
  return metadata;
365
363
  }
366
- //# sourceMappingURL=services.js.map
@@ -2,7 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  import { existsSync, readFileSync } from "node:fs";
4
4
  import { join } from "node:path";
5
- import { DATABASE_MANAGEMENT_FEATURE } from "./constants.js";
5
+ import { DATABASE_MANAGEMENT_FEATURE, PROJECT_JSON } from "./constants.js";
6
6
  import { DEFAULT_ALWAYS_ENABLED_INFRA } from "./project-config-defaults.js";
7
7
  import { discoverResourcesFromRoot } from "./services.js";
8
8
  /**
@@ -26,7 +26,7 @@ export function isSharedPlatformPostgresDependency(name) {
26
26
  }
27
27
  function readProjectJson(projectRoot) {
28
28
  try {
29
- return JSON.parse(readFileSync(join(projectRoot, ".tdk", "project.json"), "utf-8"));
29
+ return JSON.parse(readFileSync(join(projectRoot, ".tdk", PROJECT_JSON), "utf-8"));
30
30
  }
31
31
  catch {
32
32
  return undefined;
@@ -230,4 +230,3 @@ export function sharedPlatformPostgresMessage(evaluation) {
230
230
  : `resource(s) ${evaluation.dependsOnUsers.join(", ")} depend on postgres/database-management`;
231
231
  return `Shared platform Postgres will start because ${why}${projectScopeNote}`;
232
232
  }
233
- //# sourceMappingURL=shared-platform-postgres.js.map
@@ -19,4 +19,3 @@ export function singleFlight(apply) {
19
19
  }
20
20
  };
21
21
  }
22
- //# sourceMappingURL=single-flight.js.map
@@ -112,6 +112,8 @@ function readPath(value, path) {
112
112
  if (current === null || current === undefined)
113
113
  return undefined;
114
114
  // Own properties only: a path like "__proto__" must not reach inherited values.
115
+ if (part === "__proto__" || part === "constructor" || part === "prototype")
116
+ return undefined;
115
117
  if (!Object.hasOwn(current, part))
116
118
  return undefined;
117
119
  current = current[part];
@@ -330,4 +332,3 @@ export function formatSmokeFailure(result) {
330
332
  export async function runSmokePlans(plans, deps = {}) {
331
333
  return Promise.all(plans.map((plan) => runSmokePlan(plan, deps)));
332
334
  }
333
- //# sourceMappingURL=smoke.js.map
@@ -38,4 +38,3 @@ export function startSpinner(initialText) {
38
38
  warn: (message) => finish(chalk.yellow("⚠"), message),
39
39
  };
40
40
  }
41
- //# sourceMappingURL=spinner.js.map
@@ -13,4 +13,3 @@ export function isStackFeatureEnabledInStacks(stacks, featureName) {
13
13
  return false;
14
14
  return ["pre_alpha", "alpha", "beta"].some((phase) => stacks[phase]?.enabledStacks?.includes(featureName));
15
15
  }
16
- //# sourceMappingURL=stack-features.js.map
@@ -12,4 +12,3 @@ export function deriveStackStatus(statuses) {
12
12
  return "degraded";
13
13
  return "error";
14
14
  }
15
- //# sourceMappingURL=stack-status.js.map
@@ -76,4 +76,3 @@ export function formatStartupReport(report, timedOut) {
76
76
  }
77
77
  return lines;
78
78
  }
79
- //# sourceMappingURL=startup-report.js.map
@@ -19,4 +19,3 @@ export function createStatusMessageController(setMessage) {
19
19
  },
20
20
  };
21
21
  }
22
- //# sourceMappingURL=status-message.js.map
@@ -29,4 +29,3 @@ export function buildStackPorts(plan, tiltPort) {
29
29
  }
30
30
  return ports;
31
31
  }
32
- //# sourceMappingURL=status-ports.js.map
@@ -1,16 +1,20 @@
1
1
  // Copyright (c) 2026 TDK Landscape contributors
2
2
  // SPDX-License-Identifier: MIT
3
+ // Every cell is written before it is read, so the fallback never changes the result.
4
+ function cell(row, index) {
5
+ return row[index] ?? 0;
6
+ }
3
7
  function levenshteinDistance(left, right) {
4
8
  let previousRow = Array.from({ length: right.length + 1 }, (_, index) => index);
5
9
  for (let leftIndex = 1; leftIndex <= left.length; leftIndex++) {
6
10
  const currentRow = [leftIndex];
7
11
  for (let rightIndex = 1; rightIndex <= right.length; rightIndex++) {
8
12
  const substitutionCost = left[leftIndex - 1] === right[rightIndex - 1] ? 0 : 1;
9
- currentRow[rightIndex] = Math.min(currentRow[rightIndex - 1] + 1, previousRow[rightIndex] + 1, previousRow[rightIndex - 1] + substitutionCost);
13
+ currentRow[rightIndex] = Math.min(cell(currentRow, rightIndex - 1) + 1, cell(previousRow, rightIndex) + 1, cell(previousRow, rightIndex - 1) + substitutionCost);
10
14
  }
11
15
  previousRow = currentRow;
12
16
  }
13
- return previousRow[right.length];
17
+ return cell(previousRow, right.length);
14
18
  }
15
19
  function isAdjacentTransposition(left, right) {
16
20
  if (left.length !== right.length)
@@ -57,4 +61,3 @@ export function suggestClosest(input, candidates) {
57
61
  }
58
62
  return closest;
59
63
  }
60
- //# sourceMappingURL=suggestions.js.map
@@ -31,10 +31,12 @@ export function extractTarball(data, destDir) {
31
31
  throw new Error(`tar extraction failed: ${fallback.stderr?.toString() || result.stderr?.toString() || "unknown error"}`);
32
32
  }
33
33
  const entries = readdirSync(fallbackDir);
34
+ const [only] = entries;
34
35
  const sourceDir = entries.length === 1 &&
35
- existsSync(join(fallbackDir, entries[0])) &&
36
- statSync(join(fallbackDir, entries[0])).isDirectory()
37
- ? join(fallbackDir, entries[0])
36
+ only !== undefined &&
37
+ existsSync(join(fallbackDir, only)) &&
38
+ statSync(join(fallbackDir, only)).isDirectory()
39
+ ? join(fallbackDir, only)
38
40
  : fallbackDir;
39
41
  for (const entry of readdirSync(sourceDir)) {
40
42
  renameSync(join(sourceDir, entry), join(destDir, entry));
@@ -42,4 +44,3 @@ export function extractTarball(data, destDir) {
42
44
  }
43
45
  rmSync(tempDir, { recursive: true, force: true });
44
46
  }
45
- //# sourceMappingURL=tar.js.map
@@ -2,13 +2,14 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  import { readFileSync } from "node:fs";
4
4
  import { join } from "node:path";
5
+ import { PROJECT_JSON } from "./constants.js";
5
6
  function toParts(raw) {
6
7
  const match = raw.trim().match(/(\d+)\.(\d+)(?:\.(\d+))?/);
7
8
  return match ? [Number(match[1]), Number(match[2]), Number(match[3] ?? 0)] : null;
8
9
  }
9
10
  function readMinTdkVersion(projectRoot) {
10
11
  try {
11
- const parsed = JSON.parse(readFileSync(join(projectRoot, ".tdk", "project.json"), "utf-8"));
12
+ const parsed = JSON.parse(readFileSync(join(projectRoot, ".tdk", PROJECT_JSON), "utf-8"));
12
13
  return parsed?.minTdkVersion;
13
14
  }
14
15
  catch {
@@ -48,4 +49,3 @@ export function evaluateTdkVersionFloor(projectRoot, currentVersion) {
48
49
  }
49
50
  return { status: "ok", required: requiredText };
50
51
  }
51
- //# sourceMappingURL=tdk-version.js.map
@@ -17,4 +17,3 @@ export function getTabBarDensity(terminalWidth) {
17
17
  export function getListRowFromMouseY(mouseY, listTop) {
18
18
  return mouseY - 1 - listTop;
19
19
  }
20
- //# sourceMappingURL=terminal-layout.js.map
@@ -192,4 +192,3 @@ export async function loadTiltEvents() {
192
192
  throw new TiltEventsLoadError(error instanceof Error ? error.message : "Tilt returned an invalid UIResource list", "error");
193
193
  }
194
194
  }
195
- //# sourceMappingURL=tilt-events.js.map
@@ -59,4 +59,3 @@ export function parseTiltLogLines(output, limit) {
59
59
  export function isTiltConnectionFailure(stderr) {
60
60
  return /connection refused|connecting to Tilt|no such host|dial tcp|websocket_token/i.test(stderr);
61
61
  }
62
- //# sourceMappingURL=tilt-logs.js.map
@@ -52,4 +52,3 @@ export function stopTiltOnPort(port, platform = process.platform, commandRunner
52
52
  }
53
53
  return pids;
54
54
  }
55
- //# sourceMappingURL=tilt-process.js.map
@@ -30,4 +30,3 @@ export function effectiveRuntimeStatus(status) {
30
30
  return "pending";
31
31
  return runtimeStatus;
32
32
  }
33
- //# sourceMappingURL=tilt-resource-state.js.map
@@ -41,4 +41,3 @@ export async function stopTiltForUp(options, dependencies) {
41
41
  dependencies.stop(options.port);
42
42
  await dependencies.wait(2000);
43
43
  }
44
- //# sourceMappingURL=tilt-startup.js.map
@@ -7,4 +7,3 @@
7
7
  export function tiltUnreachableMessage(port) {
8
8
  return `Could not reach Tilt on port ${port}. The stack is not running, or Tilt is on another port. Start it with: tdk up`;
9
9
  }
10
- //# sourceMappingURL=tilt-unreachable-message.js.map
@@ -103,4 +103,3 @@ export function buildTiltDownArgs(options = {}) {
103
103
  }
104
104
  return args;
105
105
  }
106
- //# sourceMappingURL=tilt.js.map
@@ -5,7 +5,7 @@ export const TABS = [
5
5
  { id: "files", label: "FILES", shortcut: "4" },
6
6
  { id: "config", label: "CONFIG", shortcut: "5" },
7
7
  ];
8
- const tabRange = `${TABS[0].shortcut}-${TABS[TABS.length - 1].shortcut}`;
8
+ const tabRange = `${TABS.at(0)?.shortcut}-${TABS.at(-1)?.shortcut}`;
9
9
  const uiKeymap = [
10
10
  {
11
11
  id: "list-navigation",
@@ -115,4 +115,3 @@ export function formatUiKeyHint(id, label, ascii = false) {
115
115
  const entry = getUiKeymapEntry(id);
116
116
  return `[${formatUiKeyNames(id, ascii)}] ${label ?? entry.label}`;
117
117
  }
118
- //# sourceMappingURL=ui-keymap.js.map
@@ -32,4 +32,3 @@ export function applyServiceStates(metadata, states) {
32
32
  overallStatus: deriveStackStatus(resources.map((r) => r.status)),
33
33
  };
34
34
  }
35
- //# sourceMappingURL=ui-service-state.js.map
@@ -26,4 +26,3 @@ export function resolveOnlySelection(requested, all) {
26
26
  dependencies: all.map((r) => r.name).filter((n) => wanted.has(n) && !requested.includes(n)),
27
27
  };
28
28
  }
29
- //# sourceMappingURL=up-only.js.map