@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.
- package/CHANGELOG.md +1 -0
- package/cli/dist/backend-frameworks/elysia.js +0 -1
- package/cli/dist/backend-frameworks/express.js +0 -1
- package/cli/dist/backend-frameworks/fastify.js +0 -1
- package/cli/dist/backend-frameworks/h3.js +0 -1
- package/cli/dist/backend-frameworks/koa.js +0 -1
- package/cli/dist/backend-frameworks/mcp.js +0 -1
- package/cli/dist/backend-frameworks/nestjs.js +0 -1
- package/cli/dist/backend-frameworks/registry.js +0 -1
- package/cli/dist/backend-frameworks/types.js +0 -1
- package/cli/dist/backend-languages/bun.js +0 -1
- package/cli/dist/backend-languages/go.js +0 -1
- package/cli/dist/backend-languages/python.js +0 -1
- package/cli/dist/backend-languages/registry.js +0 -1
- package/cli/dist/backend-languages/rust.js +0 -1
- package/cli/dist/backend-languages/types.js +0 -1
- package/cli/dist/cli.js +0 -1
- package/cli/dist/commands/__tests__/project-e2e-helpers.js +0 -1
- package/cli/dist/commands/completion.js +0 -1
- package/cli/dist/commands/config.js +3 -14
- package/cli/dist/commands/doctor.js +10 -11
- package/cli/dist/commands/down.js +0 -1
- package/cli/dist/commands/eject.js +0 -1
- package/cli/dist/commands/help.js +0 -1
- package/cli/dist/commands/import.js +0 -1
- package/cli/dist/commands/logs.js +0 -1
- package/cli/dist/commands/maintainers.js +0 -1
- package/cli/dist/commands/mcp.js +0 -1
- package/cli/dist/commands/networks.js +0 -2
- package/cli/dist/commands/project.js +3 -4
- package/cli/dist/commands/projects.js +0 -1
- package/cli/dist/commands/resource.js +8 -9
- package/cli/dist/commands/resources.js +0 -1
- package/cli/dist/commands/runtime.js +0 -1
- package/cli/dist/commands/stack.js +0 -1
- package/cli/dist/commands/stacks.js +0 -1
- package/cli/dist/commands/status.js +0 -1
- package/cli/dist/commands/ui.js +8 -13
- package/cli/dist/commands/up.js +6 -7
- package/cli/dist/commands/upgrade.js +2 -2
- package/cli/dist/commands/version.js +0 -1
- package/cli/dist/components/Accessible.js +4 -3
- package/cli/dist/components/BaseTooltip.js +0 -1
- package/cli/dist/components/DetailPanel.js +0 -1
- package/cli/dist/components/FileTree.js +0 -1
- package/cli/dist/components/ResourceSelectInput.js +3 -3
- package/cli/dist/components/ResourceTable.js +0 -1
- package/cli/dist/components/ServiceIssues.js +0 -1
- package/cli/dist/components/TUIHeader.js +0 -1
- package/cli/dist/components/TabBar.js +0 -1
- package/cli/dist/components/Tooltip.js +0 -1
- package/cli/dist/components/index.js +0 -1
- package/cli/dist/components/ui-theme.js +5 -1
- package/cli/dist/config/platform-standards.js +0 -1
- package/cli/dist/frontend-frameworks/lit.js +0 -1
- package/cli/dist/frontend-frameworks/preact.js +0 -1
- package/cli/dist/frontend-frameworks/qwik.js +0 -1
- package/cli/dist/frontend-frameworks/react.js +0 -1
- package/cli/dist/frontend-frameworks/registry.js +0 -1
- package/cli/dist/frontend-frameworks/solid.js +0 -1
- package/cli/dist/frontend-frameworks/svelte.js +0 -1
- package/cli/dist/frontend-frameworks/tanstack-router.js +0 -1
- package/cli/dist/frontend-frameworks/types.js +0 -1
- package/cli/dist/frontend-frameworks/vanilla.js +0 -1
- package/cli/dist/frontend-frameworks/vue.js +0 -1
- package/cli/dist/generator/__tests__/golden-helpers.js +0 -1
- package/cli/dist/generator/extension-fetch.js +0 -1
- package/cli/dist/generator/resource-templates.js +0 -1
- package/cli/dist/generator/template-engine.js +9 -10
- package/cli/dist/index.js +0 -1
- package/cli/dist/mcp/server.js +0 -1
- package/cli/dist/mcp/tools.js +33 -14
- package/cli/dist/types/index.js +4 -6
- package/cli/dist/utils/agent-host.js +0 -1
- package/cli/dist/utils/atomic-write.js +0 -1
- package/cli/dist/utils/bun-floor.js +0 -1
- package/cli/dist/utils/bun-requirement.js +0 -1
- package/cli/dist/utils/cache.js +0 -1
- package/cli/dist/utils/cold-preflight.js +2 -2
- package/cli/dist/utils/command-helpers.js +0 -1
- package/cli/dist/utils/constants.js +18 -4
- package/cli/dist/utils/discovery-context.js +0 -1
- package/cli/dist/utils/discovery-paths.js +2 -2
- package/cli/dist/utils/docker.js +0 -1
- package/cli/dist/utils/doctor-report.js +0 -1
- package/cli/dist/utils/doctor-runtime.js +4 -5
- package/cli/dist/utils/doctor-starlark.js +0 -1
- package/cli/dist/utils/doctor-wiring.js +8 -9
- package/cli/dist/utils/down-cleanup.js +0 -1
- package/cli/dist/utils/env-validator.js +0 -1
- package/cli/dist/utils/errors.js +2 -3
- package/cli/dist/utils/exec-async.js +0 -1
- package/cli/dist/utils/file-helpers.js +1 -3
- package/cli/dist/utils/formatting.js +0 -1
- package/cli/dist/utils/generated-paths.js +5 -6
- package/cli/dist/utils/help-command.js +0 -1
- package/cli/dist/utils/host-port-config.js +2 -2
- package/cli/dist/utils/host-port-plan.js +0 -1
- package/cli/dist/utils/json-output.js +0 -1
- package/cli/dist/utils/machine-output.js +0 -1
- package/cli/dist/utils/paths.js +2 -2
- package/cli/dist/utils/platform.js +0 -1
- package/cli/dist/utils/port-assignment.js +0 -1
- package/cli/dist/utils/port-conflict-fix.js +0 -1
- package/cli/dist/utils/port-fallback-notice.js +0 -1
- package/cli/dist/utils/port-listener-probe.js +0 -1
- package/cli/dist/utils/project-config-defaults.js +0 -1
- package/cli/dist/utils/project-features.js +0 -1
- package/cli/dist/utils/project-templates.js +0 -1
- package/cli/dist/utils/prompt.js +0 -1
- package/cli/dist/utils/resource-features.js +0 -1
- package/cli/dist/utils/resource-kind.js +0 -1
- package/cli/dist/utils/schema-version-gate.js +0 -1
- package/cli/dist/utils/search-status.js +0 -1
- package/cli/dist/utils/secret-redaction.js +0 -1
- package/cli/dist/utils/service-config-checks.js +0 -1
- package/cli/dist/utils/service-manifest.js +0 -1
- package/cli/dist/utils/service-runtime-state.js +0 -1
- package/cli/dist/utils/service-urls.js +2 -2
- package/cli/dist/utils/services.js +3 -6
- package/cli/dist/utils/shared-platform-postgres.js +2 -3
- package/cli/dist/utils/single-flight.js +0 -1
- package/cli/dist/utils/smoke.js +2 -1
- package/cli/dist/utils/spinner.js +0 -1
- package/cli/dist/utils/stack-features.js +0 -1
- package/cli/dist/utils/stack-status.js +0 -1
- package/cli/dist/utils/startup-report.js +0 -1
- package/cli/dist/utils/status-message.js +0 -1
- package/cli/dist/utils/status-ports.js +0 -1
- package/cli/dist/utils/suggestions.js +6 -3
- package/cli/dist/utils/tar.js +5 -4
- package/cli/dist/utils/tdk-version.js +2 -2
- package/cli/dist/utils/terminal-layout.js +0 -1
- package/cli/dist/utils/tilt-events.js +0 -1
- package/cli/dist/utils/tilt-logs.js +0 -1
- package/cli/dist/utils/tilt-process.js +0 -1
- package/cli/dist/utils/tilt-resource-state.js +0 -1
- package/cli/dist/utils/tilt-startup.js +0 -1
- package/cli/dist/utils/tilt-unreachable-message.js +0 -1
- package/cli/dist/utils/tilt.js +0 -1
- package/cli/dist/utils/ui-keymap.js +1 -2
- package/cli/dist/utils/ui-service-state.js +0 -1
- package/cli/dist/utils/up-only.js +0 -1
- package/cli/dist/utils/up-readiness.js +0 -1
- package/cli/dist/utils/validation.js +0 -1
- package/cli/dist/utils/which.js +0 -1
- package/cli/dist/utils/windows-doctor.js +0 -1
- package/cli/dist-bundle/chunk-42IVF3YT.js +3 -0
- package/cli/dist-bundle/chunk-CJ3L25OH.js +315 -0
- package/cli/dist-bundle/cli.js +211 -211
- package/cli/dist-bundle/{cold-preflight-LV5MPGEA.js → cold-preflight-KLI6R3XF.js} +1 -1
- package/cli/dist-bundle/{extension-fetch-COIG2KR6.js → extension-fetch-6XNTDF44.js} +1 -1
- package/cli/package.json +1 -1
- package/engine/topologies/platform/docker/AGENTS.md +13 -13
- package/engine/topologies/platform/docker/dockerfile/language_dockerfile.star +6 -2
- package/engine/topologies/tilt/manifest/README.md +1 -15
- package/package.json +1 -1
- package/cli/dist-bundle/chunk-7IDEZ54B.js +0 -315
- package/cli/dist-bundle/chunk-OBQS5CYC.js +0 -3
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { BaseTooltip } from "./BaseTooltip.js";
|
|
3
|
+
import { useTUITheme } from "./ui-theme.js";
|
|
3
4
|
/**
|
|
4
5
|
* Info tooltip variant with predefined accessibility styling.
|
|
5
|
-
* Uses ℹ prefix and adds margin for better visibility.
|
|
6
|
+
* Uses an ℹ prefix ([i] in ASCII mode) and adds margin for better visibility.
|
|
6
7
|
*/
|
|
7
8
|
export const AccessibleTooltip = ({ content, shortcut, visible }) => {
|
|
8
|
-
|
|
9
|
+
const theme = useTUITheme();
|
|
10
|
+
return (_jsx(BaseTooltip, { content: content, shortcut: shortcut, visible: visible, prefix: theme.ascii ? "[i] " : "ℹ ", marginTop: 1 }));
|
|
9
11
|
};
|
|
10
|
-
//# sourceMappingURL=Accessible.js.map
|
|
@@ -31,4 +31,3 @@ export const DetailPanel = ({ stack, service, stackMetadata, visible, }) => {
|
|
|
31
31
|
}
|
|
32
32
|
return (_jsxs(Box, { width: 40, borderStyle: theme.ascii ? undefined : "single", borderColor: theme.border, paddingX: 2, paddingY: 2, flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, justifyContent: "center", children: _jsx(Text, { color: theme.muted, dimColor: theme.dimMuted, children: "Select a stack or service" }) }), _jsx(Box, { justifyContent: "center", children: _jsx(Text, { color: theme.muted, dimColor: theme.dimMuted, children: "to view details" }) })] }));
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=DetailPanel.js.map
|
|
@@ -31,12 +31,12 @@ export const ResourceSelectInput = ({ items, onSelect, highlightedIndex, width,
|
|
|
31
31
|
if (item)
|
|
32
32
|
onSelect(item);
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
const current = items[selected];
|
|
35
|
+
if (key.return && current)
|
|
36
|
+
onSelect(current);
|
|
36
37
|
}, { isActive });
|
|
37
38
|
return (_jsx(Box, { ref: listRef, flexDirection: "column", width: width, children: items.slice(firstVisible, firstVisible + visibleCount).map((item, index) => {
|
|
38
39
|
const isSelected = firstVisible + index === selected;
|
|
39
40
|
return (_jsx(Box, { width: width, children: _jsxs(Text, { wrap: "truncate-end", children: [_jsx(Text, { color: isSelected ? theme.selectedForeground : theme.muted, backgroundColor: isSelected ? theme.selectedBackground : undefined, children: isSelected ? `${theme.selectionMarker} ` : " " }), _jsx(Text, { color: isSelected ? theme.selectedForeground : theme.foreground, bold: isSelected || theme.highContrast, backgroundColor: isSelected ? theme.selectedBackground : undefined, children: item.label })] }) }, item.value));
|
|
40
41
|
}) }));
|
|
41
42
|
};
|
|
42
|
-
//# sourceMappingURL=ResourceSelectInput.js.map
|
|
@@ -33,4 +33,3 @@ export const ResourceTable = ({ resources, maxWidth = 100 }) => {
|
|
|
33
33
|
return (_jsxs(Box, { flexDirection: "row", paddingX: 1, children: [_jsx(Box, { width: nameWidth, children: _jsx(Text, { color: theme.foreground, children: truncate(resource.name, Math.max(3, nameWidth - 1)) }) }), _jsx(Box, { width: stackWidth, children: _jsx(Text, { color: theme.muted, children: truncate(stackName, Math.max(3, stackWidth - 1)) }) }), _jsx(Box, { width: typeWidth, children: _jsx(Text, { color: theme.accent, bold: theme.highContrast, children: truncate(resource.type, Math.max(3, typeWidth - 1)) }) }), _jsx(Box, { width: statusWidth, children: _jsx(Text, { color: statusColor, bold: theme.highContrast, children: truncate(statusLabel, Math.max(3, statusWidth - 1)) }) }), !narrowMode && (_jsx(Box, { width: createdWidth, children: _jsx(Text, { color: theme.muted, children: truncate(formatShortDate(resource.createdAt), Math.max(3, createdWidth - 1)) }) }))] }, resource.name));
|
|
34
34
|
})] }));
|
|
35
35
|
};
|
|
36
|
-
//# sourceMappingURL=ResourceTable.js.map
|
|
@@ -11,4 +11,3 @@ export function ServiceIssues({ resources }) {
|
|
|
11
11
|
return null;
|
|
12
12
|
return (_jsx(Box, { flexDirection: "column", marginTop: 1, children: issues.map((resource) => (_jsxs(Text, { color: theme.muted, children: [resource.name, ": ", resource.statusReason] }, resource.name))) }));
|
|
13
13
|
}
|
|
14
|
-
//# sourceMappingURL=ServiceIssues.js.map
|
|
@@ -24,4 +24,3 @@ export const TUIHeader = ({ projectRoot, resourceCount, terminalWidth, version,
|
|
|
24
24
|
const rootWidth = contentWidth - headingWidth;
|
|
25
25
|
return (_jsxs(Box, { flexDirection: "row", paddingX: paddingX, width: terminalWidth, children: [_jsx(Text, { color: theme.accent, bold: true, children: title }), _jsx(Text, { color: theme.muted, children: " | " }), _jsx(Box, { flexShrink: 0, width: rootWidth, children: _jsx(Text, { color: theme.foreground, wrap: "truncate-end", children: projectRoot }) }), _jsx(Text, { color: theme.muted, children: " | " }), _jsx(Text, { color: theme.success, children: resourceLabel })] }));
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=TUIHeader.js.map
|
|
@@ -25,4 +25,3 @@ export const TabBar = ({ activeTab, compact = false, terminalWidth }) => {
|
|
|
25
25
|
return (_jsx(Box, { children: compactLayout ? (_jsxs(Text, { color: isActive ? theme.selectedForeground : theme.muted, bold: isActive || theme.highContrast, backgroundColor: isActive ? theme.selectedBackground : undefined, children: [isActive ? `${theme.selectionMarker} ` : "", "[", tab.shortcut, "] ", label] })) : isActive ? (_jsx(Box, { ...selectedBorderProps, paddingX: wide ? 1 : 0, backgroundColor: theme.selectedBackground, children: _jsxs(Text, { children: [wide && _jsx(Text, { color: theme.selectedForeground, children: theme.bannerStart }), _jsxs(Text, { color: theme.selectedForeground, bold: true, children: [" ", "[", tab.shortcut, "] ", label, " "] }), wide && _jsx(Text, { color: theme.selectedForeground, children: theme.bannerEnd })] }) })) : (_jsx(Box, { paddingX: wide ? 1 : 0, children: _jsxs(Text, { color: theme.muted, dimColor: theme.dimMuted, bold: theme.highContrast, children: ["[", tab.shortcut, "] ", label] }) })) }, tab.id));
|
|
26
26
|
}) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: theme.muted, dimColor: theme.dimMuted, children: divider }) })] }));
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=TabBar.js.map
|
|
@@ -84,6 +84,7 @@ export function createTUITheme(highContrast, environment = process.env) {
|
|
|
84
84
|
bannerStart: ascii ? ">>>" : "\u2593\u2592\u2591",
|
|
85
85
|
bannerEnd: ascii ? "<<<" : "\u2591\u2592\u2593",
|
|
86
86
|
selectionMarker: ascii ? ">>>" : "\u2593\u2592\u2591",
|
|
87
|
+
separator: ascii ? " | " : " \u2502 ",
|
|
87
88
|
};
|
|
88
89
|
}
|
|
89
90
|
const STATUS_COLOR_THEMES = {
|
|
@@ -108,9 +109,12 @@ export function getTUIStatusIcon(theme, icon, color) {
|
|
|
108
109
|
return "[x]";
|
|
109
110
|
return "[?]";
|
|
110
111
|
}
|
|
112
|
+
/** Return a tab section heading suited to the active terminal character set. */
|
|
113
|
+
export function sectionTitle(theme, title) {
|
|
114
|
+
return theme.ascii ? `[ ${title} ]` : `┌─ ${title} ─`;
|
|
115
|
+
}
|
|
111
116
|
export const TUIThemeContext = createContext(createTUITheme(false));
|
|
112
117
|
/** Read the theme provided to the current TUI subtree. */
|
|
113
118
|
export function useTUITheme() {
|
|
114
119
|
return useContext(TUIThemeContext);
|
|
115
120
|
}
|
|
116
|
-
//# sourceMappingURL=ui-theme.js.map
|
|
@@ -6,7 +6,7 @@ import { fileURLToPath } from "node:url";
|
|
|
6
6
|
import Handlebars from "handlebars";
|
|
7
7
|
import { PLATFORM_STANDARDS } from "../config/platform-standards.js";
|
|
8
8
|
import { writeTextFileAtomic } from "../utils/atomic-write.js";
|
|
9
|
-
import { DATABASE_MANAGEMENT_FEATURE, TILTIGNORE_FILE } from "../utils/constants.js";
|
|
9
|
+
import { AUTOGENERATED_DIR, DATABASE_MANAGEMENT_FEATURE, DOCKER_COMPOSE_FILE, PACKAGE_JSON, PROJECT_JSON, RESOURCE_DEFAULTS_FILE, TECH_STACK_FILE, TILTIGNORE_FILE, } from "../utils/constants.js";
|
|
10
10
|
import { writeTextFile } from "../utils/file-helpers.js";
|
|
11
11
|
import { assertTdkGeneratedPath } from "../utils/generated-paths.js";
|
|
12
12
|
import { DEFAULT_ALWAYS_ENABLED_INFRA } from "../utils/project-config-defaults.js";
|
|
@@ -54,8 +54,8 @@ function getEmbeddedTemplates() {
|
|
|
54
54
|
if (!embeddedTemplatesCache) {
|
|
55
55
|
embeddedTemplatesCache = {
|
|
56
56
|
[TILTIGNORE_FILE]: loadTemplate(".tiltignore.hbs"),
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
[RESOURCE_DEFAULTS_FILE]: loadTemplate("TILT_RESOURCE_DEFAULTS.star.hbs"),
|
|
58
|
+
[TECH_STACK_FILE]: loadTemplate("TILT_TECH_STACK.star.hbs"),
|
|
59
59
|
Tiltfile: loadTemplate("Tiltfile.hbs"),
|
|
60
60
|
"spec.master": loadTemplate("spec.master.hbs"),
|
|
61
61
|
};
|
|
@@ -175,11 +175,11 @@ export class TemplateEngine {
|
|
|
175
175
|
return Handlebars.compile(templateSource);
|
|
176
176
|
}
|
|
177
177
|
generateTechStack(context) {
|
|
178
|
-
const template = this.loadTemplate(
|
|
178
|
+
const template = this.loadTemplate(TECH_STACK_FILE);
|
|
179
179
|
return template(context);
|
|
180
180
|
}
|
|
181
181
|
generateServiceDefaults(context) {
|
|
182
|
-
const template = this.loadTemplate(
|
|
182
|
+
const template = this.loadTemplate(RESOURCE_DEFAULTS_FILE);
|
|
183
183
|
return template(context);
|
|
184
184
|
}
|
|
185
185
|
generateSpecMaster(context) {
|
|
@@ -365,7 +365,7 @@ function normalizeProjectConfig(value) {
|
|
|
365
365
|
export class ProjectConfigNotFoundError extends Error {
|
|
366
366
|
}
|
|
367
367
|
export function readProjectConfig(projectRoot) {
|
|
368
|
-
const projectJsonPath = path.join(projectRoot, ".tdk",
|
|
368
|
+
const projectJsonPath = path.join(projectRoot, ".tdk", PROJECT_JSON);
|
|
369
369
|
if (!fs.existsSync(projectJsonPath)) {
|
|
370
370
|
throw new ProjectConfigNotFoundError(`Project config not found: ${projectJsonPath}. Run 'tdk project --yes' first.`);
|
|
371
371
|
}
|
|
@@ -405,7 +405,7 @@ async function warnIfSablierUnlicensed(projectRoot) {
|
|
|
405
405
|
"or remove the `sablier` block from the affected service.json file(s) to silence this warning.");
|
|
406
406
|
}
|
|
407
407
|
function ensureRootWorkspaceManifest(projectRoot, projectConfig) {
|
|
408
|
-
const packageJsonPath = assertTdkGeneratedPath(projectRoot,
|
|
408
|
+
const packageJsonPath = assertTdkGeneratedPath(projectRoot, PACKAGE_JSON);
|
|
409
409
|
if (fs.existsSync(packageJsonPath)) {
|
|
410
410
|
return false;
|
|
411
411
|
}
|
|
@@ -464,7 +464,7 @@ export async function generateMasterConfigs(projectRoot, options = {}) {
|
|
|
464
464
|
console.log(`✓ Generated: .tdk/.tdk-out/${filename}`);
|
|
465
465
|
}
|
|
466
466
|
if (isStackFeatureEnabledInStacks(projectConfig.phases, DATABASE_MANAGEMENT_FEATURE)) {
|
|
467
|
-
const composePath = assertTdkGeneratedPath(projectRoot, path.join("services", "platform", DATABASE_MANAGEMENT_FEATURE,
|
|
467
|
+
const composePath = assertTdkGeneratedPath(projectRoot, path.join("services", "platform", DATABASE_MANAGEMENT_FEATURE, DOCKER_COMPOSE_FILE));
|
|
468
468
|
const composeDir = path.dirname(composePath);
|
|
469
469
|
fs.mkdirSync(composeDir, { recursive: true });
|
|
470
470
|
writeTextFileAtomic(composePath, generateDatabaseManagementCompose(projectConfig));
|
|
@@ -696,7 +696,7 @@ function createUnifiedDiff(file, actual, expected) {
|
|
|
696
696
|
}
|
|
697
697
|
function verifyGeneratedResourceFiles(projectRoot, serviceJsonPath) {
|
|
698
698
|
const serviceDir = path.dirname(serviceJsonPath);
|
|
699
|
-
const generatedDir = path.join(serviceDir,
|
|
699
|
+
const generatedDir = path.join(serviceDir, AUTOGENERATED_DIR);
|
|
700
700
|
if (!fs.existsSync(generatedDir))
|
|
701
701
|
return { errors: [], handEdited: [] };
|
|
702
702
|
const generatedFiles = [];
|
|
@@ -746,4 +746,3 @@ function verifyGeneratedResourceFiles(projectRoot, serviceJsonPath) {
|
|
|
746
746
|
}
|
|
747
747
|
return { errors, handEdited };
|
|
748
748
|
}
|
|
749
|
-
//# sourceMappingURL=template-engine.js.map
|
package/cli/dist/index.js
CHANGED
|
@@ -8,4 +8,3 @@ export { findProjectRoot } from "./utils/paths.js";
|
|
|
8
8
|
export { checkPortStatus, findAvailablePort, } from "./utils/port-assignment.js";
|
|
9
9
|
export { clearMetadataCache, discoverResources, discoverStacks, getAllStacks, getResourceMetadata, getResourcesForStack, getStackMetadata, stackExists, } from "./utils/services.js";
|
|
10
10
|
export { buildTiltDownArgs, buildTiltUpArgs, getTiltfilePath, isTiltAvailable, runTilt, } from "./utils/tilt.js";
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
package/cli/dist/mcp/server.js
CHANGED
package/cli/dist/mcp/tools.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { spawn } from "node:child_process";
|
|
4
4
|
import { closeSync, existsSync, openSync, readFileSync } from "node:fs";
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
6
|
-
import { join } from "node:path";
|
|
6
|
+
import { isAbsolute, join } from "node:path";
|
|
7
7
|
/** A service or stack name. A leading "-" is rejected so a value can never be read as a flag. */
|
|
8
8
|
const NAME = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
9
9
|
const SINCE = /^(\d+(\.\d+)?(ns|us|µs|ms|s|m|h))+$/;
|
|
@@ -21,6 +21,7 @@ export function cliInvocation(execPath = process.execPath, script = process.argv
|
|
|
21
21
|
export const runTdkCli = (args, options = {}) => new Promise((resolve, reject) => {
|
|
22
22
|
const [command, ...prefix] = cliInvocation();
|
|
23
23
|
const child = spawn(command, [...prefix, ...args], {
|
|
24
|
+
cwd: options.cwd,
|
|
24
25
|
stdio: ["ignore", "pipe", "pipe"],
|
|
25
26
|
env: { ...process.env, NO_COLOR: "1" },
|
|
26
27
|
});
|
|
@@ -96,10 +97,11 @@ export function toToolResult(run) {
|
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
export const defaultUpDeps = {
|
|
99
|
-
spawnUp(args, logFile) {
|
|
100
|
+
spawnUp(args, logFile, cwd) {
|
|
100
101
|
const fd = openSync(logFile, "a");
|
|
101
102
|
const [command, ...prefix] = cliInvocation();
|
|
102
103
|
const child = spawn(command, [...prefix, ...args], {
|
|
104
|
+
cwd,
|
|
103
105
|
detached: true,
|
|
104
106
|
stdio: ["ignore", fd, fd],
|
|
105
107
|
env: { ...process.env, NO_COLOR: "1" },
|
|
@@ -140,7 +142,7 @@ export function buildUpArgs(args) {
|
|
|
140
142
|
export async function startUp(args, deps = defaultUpDeps) {
|
|
141
143
|
const argv = buildUpArgs(args);
|
|
142
144
|
const logFile = deps.logFile();
|
|
143
|
-
const child = deps.spawnUp(argv, logFile);
|
|
145
|
+
const child = deps.spawnUp(argv, logFile, projectPath(args.projectPath));
|
|
144
146
|
let exited;
|
|
145
147
|
child.once("exit", (code) => {
|
|
146
148
|
exited = code;
|
|
@@ -203,13 +205,26 @@ const OBJECT = (properties) => ({
|
|
|
203
205
|
properties,
|
|
204
206
|
additionalProperties: false,
|
|
205
207
|
});
|
|
208
|
+
const PROJECT_PATH = {
|
|
209
|
+
type: "string",
|
|
210
|
+
description: "Absolute path to the TDK project root; run this operation from that directory.",
|
|
211
|
+
};
|
|
212
|
+
function projectPath(value) {
|
|
213
|
+
if (value === undefined)
|
|
214
|
+
return undefined;
|
|
215
|
+
if (typeof value !== "string" || !isAbsolute(value)) {
|
|
216
|
+
throw new Error("projectPath must be an absolute path to a TDK project root");
|
|
217
|
+
}
|
|
218
|
+
return value;
|
|
219
|
+
}
|
|
206
220
|
export function createTdkTools(run = runTdkCli, up = defaultUpDeps) {
|
|
207
|
-
const viaCli = (build) => async (args) => toToolResult(await run(build(args)));
|
|
221
|
+
const viaCli = (build) => async (args) => toToolResult(await run(build(args), { cwd: projectPath(args.projectPath) }));
|
|
208
222
|
return [
|
|
209
223
|
{
|
|
210
224
|
name: "doctor",
|
|
211
|
-
description: "Check whether this machine can run the TDK stack. Returns data.ready and data.host.canUp; run it before `up`.",
|
|
225
|
+
description: "Check whether this machine can run the TDK stack. Optionally set projectPath to include checks for a specific TDK project. Returns data.ready and data.host.canUp; run it before `up`.",
|
|
212
226
|
inputSchema: OBJECT({
|
|
227
|
+
projectPath: PROJECT_PATH,
|
|
213
228
|
noPing: { type: "boolean", description: "Skip pinging running services' health endpoints" },
|
|
214
229
|
}),
|
|
215
230
|
handler: viaCli((args) => [
|
|
@@ -220,8 +235,9 @@ export function createTdkTools(run = runTdkCli, up = defaultUpDeps) {
|
|
|
220
235
|
},
|
|
221
236
|
{
|
|
222
237
|
name: "up",
|
|
223
|
-
description: "Start the stack (or part of it) detached and return without waiting for it to be ready. Poll `status` for data.tilt.readiness.ready. Fails fast on an unknown service, an unsupported host, or a Tilt already running.",
|
|
238
|
+
description: "Start the stack (or part of it) detached from the optional projectPath and return without waiting for it to be ready. Poll `status` for data.tilt.readiness.ready. Fails fast on an unknown service, an unsupported host, or a Tilt already running.",
|
|
224
239
|
inputSchema: OBJECT({
|
|
240
|
+
projectPath: PROJECT_PATH,
|
|
225
241
|
stack: { type: "string", description: "Only this stack" },
|
|
226
242
|
only: {
|
|
227
243
|
type: "array",
|
|
@@ -238,20 +254,21 @@ export function createTdkTools(run = runTdkCli, up = defaultUpDeps) {
|
|
|
238
254
|
},
|
|
239
255
|
{
|
|
240
256
|
name: "down",
|
|
241
|
-
description: "Stop the running stack.",
|
|
242
|
-
inputSchema: OBJECT({}),
|
|
257
|
+
description: "Stop the running stack, optionally selecting its project with projectPath.",
|
|
258
|
+
inputSchema: OBJECT({ projectPath: PROJECT_PATH }),
|
|
243
259
|
handler: viaCli(() => ["down", "--json"]),
|
|
244
260
|
},
|
|
245
261
|
{
|
|
246
262
|
name: "status",
|
|
247
|
-
description: "Stacks, resources, their ingress URLs and container ports, the stack-level ports, and Tilt readiness (data.tilt.readiness: ready, pending, failures, enabled; null when no Tilt answers).",
|
|
248
|
-
inputSchema: OBJECT({}),
|
|
263
|
+
description: "Stacks, resources, their ingress URLs and container ports, the stack-level ports, and Tilt readiness (data.tilt.readiness: ready, pending, failures, enabled; null when no Tilt answers). Optionally select the project with projectPath.",
|
|
264
|
+
inputSchema: OBJECT({ projectPath: PROJECT_PATH }),
|
|
249
265
|
handler: viaCli(() => ["status", "--json"]),
|
|
250
266
|
},
|
|
251
267
|
{
|
|
252
268
|
name: "logs",
|
|
253
|
-
description: "A bounded snapshot of recent logs from the running stack (default the last 200 lines, at most 10000). Not a stream.",
|
|
269
|
+
description: "A bounded snapshot of recent logs from the running stack (default the last 200 lines, at most 10000). Optionally select the project with projectPath. Not a stream.",
|
|
254
270
|
inputSchema: OBJECT({
|
|
271
|
+
projectPath: PROJECT_PATH,
|
|
255
272
|
services: { type: "array", items: { type: "string" }, description: "Only these services" },
|
|
256
273
|
tail: { type: "integer", minimum: 1, maximum: 10000 },
|
|
257
274
|
since: {
|
|
@@ -263,8 +280,11 @@ export function createTdkTools(run = runTdkCli, up = defaultUpDeps) {
|
|
|
263
280
|
},
|
|
264
281
|
{
|
|
265
282
|
name: "resource_list",
|
|
266
|
-
description: "List the project's services (resources) with their stack, type and port.",
|
|
267
|
-
inputSchema: OBJECT({
|
|
283
|
+
description: "List the selected project's services (resources) with their stack, type and port. Set projectPath when the MCP server is not running from the project root.",
|
|
284
|
+
inputSchema: OBJECT({
|
|
285
|
+
projectPath: PROJECT_PATH,
|
|
286
|
+
stack: { type: "string", description: "Only this stack" },
|
|
287
|
+
}),
|
|
268
288
|
handler: viaCli((args) => {
|
|
269
289
|
const stack = optionalName(args.stack, "stack");
|
|
270
290
|
return ["resources", "--json", ...(stack ? [`--stack=${stack}`] : [])];
|
|
@@ -272,4 +292,3 @@ export function createTdkTools(run = runTdkCli, up = defaultUpDeps) {
|
|
|
272
292
|
},
|
|
273
293
|
];
|
|
274
294
|
}
|
|
275
|
-
//# sourceMappingURL=tools.js.map
|
package/cli/dist/types/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// Copyright (c) 2026 TDK Landscape contributors
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
import { RESOURCE_DEFAULTS_FILE, TECH_STACK_FILE } from "../utils/constants.js";
|
|
1
4
|
export const RESOURCE_CONFIG_APP_TYPES = [
|
|
2
5
|
"backend",
|
|
3
6
|
"frontend",
|
|
@@ -23,11 +26,6 @@ export function isCreatableResourceType(value) {
|
|
|
23
26
|
* Eliminates the need for 'as MasterConfigFileName' assertion.
|
|
24
27
|
*/
|
|
25
28
|
export function isMasterConfigFileName(filename) {
|
|
26
|
-
const validNames = [
|
|
27
|
-
"TILT_TECH_STACK.star",
|
|
28
|
-
"TILT_RESOURCE_DEFAULTS.star",
|
|
29
|
-
"spec.master",
|
|
30
|
-
];
|
|
29
|
+
const validNames = [TECH_STACK_FILE, RESOURCE_DEFAULTS_FILE, "spec.master"];
|
|
31
30
|
return validNames.includes(filename);
|
|
32
31
|
}
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
package/cli/dist/utils/cache.js
CHANGED
|
@@ -6,6 +6,7 @@ import { join } from "node:path";
|
|
|
6
6
|
import { checkDockerCompose, checkDockerRuntime, checkDockerVersions, checkTilt, } from "../commands/doctor.js";
|
|
7
7
|
import { BUN_FLOOR_LABEL, bunMeetsFloor } from "./bun-floor.js";
|
|
8
8
|
import { projectNeedsBun } from "./bun-requirement.js";
|
|
9
|
+
import { PROJECT_JSON } from "./constants.js";
|
|
9
10
|
import { checkNatsBroker } from "./doctor-wiring.js";
|
|
10
11
|
import { getHostPortPlan } from "./host-port-config.js";
|
|
11
12
|
import { findProjectRoot } from "./paths.js";
|
|
@@ -131,7 +132,7 @@ export async function runColdPreflight(opts = {}) {
|
|
|
131
132
|
if (usesPrisma(projectRoot)) {
|
|
132
133
|
let dbUp = false;
|
|
133
134
|
try {
|
|
134
|
-
const config = JSON.parse(readFileSync(join(projectRoot, ".tdk",
|
|
135
|
+
const config = JSON.parse(readFileSync(join(projectRoot, ".tdk", PROJECT_JSON), "utf-8"));
|
|
135
136
|
const projectName = String(config?.project?.name ?? "").replace(/-/g, "_");
|
|
136
137
|
if (projectName) {
|
|
137
138
|
const running = execFileSync(findOnPath("docker") ?? "docker", [
|
|
@@ -198,4 +199,3 @@ export async function assertMachineReadyOrExit() {
|
|
|
198
199
|
process.exit(1);
|
|
199
200
|
}
|
|
200
201
|
}
|
|
201
|
-
//# sourceMappingURL=cold-preflight.js.map
|
|
@@ -17,9 +17,24 @@ export const DATABASE_MANAGEMENT_FEATURE = "database-management";
|
|
|
17
17
|
export const TILTIGNORE_FILE = ".tiltignore";
|
|
18
18
|
// Manifest file name for a resource, used by discovery and the resource command.
|
|
19
19
|
export const SERVICE_JSON = "service.json";
|
|
20
|
+
// Compose file name for service resources and platform features.
|
|
21
|
+
export const DOCKER_COMPOSE_FILE = "docker-compose.yml";
|
|
22
|
+
// Directory where generated manifests, configs, and Dockerfiles live within each resource.
|
|
23
|
+
export const AUTOGENERATED_DIR = ".autogenerated";
|
|
24
|
+
export const TECH_STACK_FILE = "TILT_TECH_STACK.star";
|
|
25
|
+
export const RESOURCE_DEFAULTS_FILE = "TILT_RESOURCE_DEFAULTS.star";
|
|
26
|
+
// TDK project manifest file name. The canonical project config lives at
|
|
27
|
+
// `<project-root>/.tdk/project.json` — discovery, doctor, generator, config
|
|
28
|
+
// edits, and stack-features all read/write it. Referenced by value across
|
|
29
|
+
// these modules, so a typo in one copy would compile and silently stop
|
|
30
|
+
// matching (or worse, read a different file). Keep the literal here and
|
|
31
|
+
// import it everywhere it's needed.
|
|
32
|
+
export const PROJECT_JSON = "project.json";
|
|
33
|
+
// Manifest file name for Node / JavaScript packages and root workspace.
|
|
34
|
+
export const PACKAGE_JSON = "package.json";
|
|
20
35
|
export const MASTER_CONFIG_FILES = [
|
|
21
|
-
|
|
22
|
-
|
|
36
|
+
TECH_STACK_FILE,
|
|
37
|
+
RESOURCE_DEFAULTS_FILE,
|
|
23
38
|
"spec.master",
|
|
24
39
|
];
|
|
25
40
|
export const VALID_RESOURCE_TYPES = [
|
|
@@ -114,7 +129,7 @@ export const SKIP_DIRECTORIES = [
|
|
|
114
129
|
];
|
|
115
130
|
export const AUTOGENERATED_FILE_PATTERNS = [
|
|
116
131
|
"Dockerfile",
|
|
117
|
-
|
|
132
|
+
DOCKER_COMPOSE_FILE,
|
|
118
133
|
"docker-compose.yaml",
|
|
119
134
|
"Tiltfile",
|
|
120
135
|
"vite.config.ts",
|
|
@@ -139,4 +154,3 @@ export function getStackEmoji(stackName) {
|
|
|
139
154
|
}
|
|
140
155
|
return "📦";
|
|
141
156
|
}
|
|
142
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
4
|
import { join, relative, resolve, sep } from "node:path";
|
|
5
|
+
import { PROJECT_JSON } from "./constants.js";
|
|
5
6
|
// Mirrors discovery/json_manifest_scanner.star: every `discovery.paths` entry is a shell
|
|
6
7
|
// glob of directories, and `find -maxdepth 3` looks for service.json under each match. So a
|
|
7
8
|
// resource is only seen by Tilt if some directory matching a pattern is the resource
|
|
@@ -48,7 +49,7 @@ function globMatchesDir(patternSegments, dirSegments) {
|
|
|
48
49
|
}
|
|
49
50
|
/** `discovery.paths` from .tdk/project.json, or the generic default when unset/unreadable. */
|
|
50
51
|
export function readDiscoveryPaths(projectRoot) {
|
|
51
|
-
const configPath = join(projectRoot, ".tdk",
|
|
52
|
+
const configPath = join(projectRoot, ".tdk", PROJECT_JSON);
|
|
52
53
|
if (!existsSync(configPath))
|
|
53
54
|
return DEFAULT_DISCOVERY_PATHS;
|
|
54
55
|
try {
|
|
@@ -90,4 +91,3 @@ export function chooseResourcePath(projectRoot, conventionalPath, stack, name) {
|
|
|
90
91
|
}
|
|
91
92
|
return { path: conventionalPath };
|
|
92
93
|
}
|
|
93
|
-
//# sourceMappingURL=discovery-paths.js.map
|
package/cli/dist/utils/docker.js
CHANGED
|
@@ -4,7 +4,7 @@ import { execFileSync, execSync } from "node:child_process";
|
|
|
4
4
|
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
5
5
|
import { createServer } from "node:net";
|
|
6
6
|
import { join } from "node:path";
|
|
7
|
-
import { STANDARD_PORTS } from "./constants.js";
|
|
7
|
+
import { AUTOGENERATED_DIR, PACKAGE_JSON, PROJECT_JSON, STANDARD_PORTS } from "./constants.js";
|
|
8
8
|
import { formatCount } from "./formatting.js";
|
|
9
9
|
import { findProjectRoot } from "./paths.js";
|
|
10
10
|
import { isApiServiceType } from "./resource-kind.js";
|
|
@@ -204,7 +204,7 @@ export function isRegistryRelatedBuildError(error) {
|
|
|
204
204
|
return /ConnectionRefused downloading package manifest|Verdaccio|private registry|dependency install failed during ImageBuild|install-deps\.sh|bun install/i.test(error);
|
|
205
205
|
}
|
|
206
206
|
export function projectConfigEnablesVerdaccio(projectRoot = findProjectRoot() ?? process.cwd()) {
|
|
207
|
-
const projectJsonPath = join(projectRoot, ".tdk",
|
|
207
|
+
const projectJsonPath = join(projectRoot, ".tdk", PROJECT_JSON);
|
|
208
208
|
if (!existsSync(projectJsonPath))
|
|
209
209
|
return false;
|
|
210
210
|
try {
|
|
@@ -217,7 +217,7 @@ export function projectConfigEnablesVerdaccio(projectRoot = findProjectRoot() ??
|
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
function npmrcPointsAtVerdaccio(projectRoot) {
|
|
220
|
-
for (const candidate of [join(projectRoot, ".npmrc"), join(projectRoot,
|
|
220
|
+
for (const candidate of [join(projectRoot, ".npmrc"), join(projectRoot, PACKAGE_JSON)]) {
|
|
221
221
|
if (!existsSync(candidate))
|
|
222
222
|
continue;
|
|
223
223
|
try {
|
|
@@ -713,7 +713,7 @@ export function describeTiltFailure(failure, exec = execSync) {
|
|
|
713
713
|
return failure.updateStatus || failure.runtimeStatus || "unknown error";
|
|
714
714
|
}
|
|
715
715
|
const SOURCE_FILE = /\.(ts|tsx|mts|js|mjs|cjs)$/;
|
|
716
|
-
const SKIPPED_DIRS = new Set(["node_modules", "dist",
|
|
716
|
+
const SKIPPED_DIRS = new Set(["node_modules", "dist", AUTOGENERATED_DIR, "tests", "__tests__"]);
|
|
717
717
|
function listSourceFiles(dir) {
|
|
718
718
|
const files = [];
|
|
719
719
|
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
@@ -817,4 +817,3 @@ export function checkHealthRoutes(projectRoot = findProjectRoot() ?? process.cwd
|
|
|
817
817
|
'To use a different path, set "healthCheckPath" (container healthcheck) or "traefik.healthCheck" (Traefik) in its service.json.',
|
|
818
818
|
};
|
|
819
819
|
}
|
|
820
|
-
//# sourceMappingURL=doctor-runtime.js.map
|
|
@@ -130,4 +130,3 @@ export function checkStarlarkLoadExports() {
|
|
|
130
130
|
fix: "Regenerate with a current TDK (`tdk config regenerate`). If the issue remains, rename loaded symbols without leading underscores and update stale load paths.",
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
//# sourceMappingURL=doctor-starlark.js.map
|