@tileflow/dev 0.1.0-alpha.2 → 0.1.0-alpha.21

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.
@@ -0,0 +1,145 @@
1
+ import {
2
+ isPathWithin
3
+ } from "./chunk-D4OE4ITL.js";
4
+
5
+ // src/preview-assets.ts
6
+ import { readFileSync } from "fs";
7
+ import { createRequire } from "module";
8
+ import { dirname, join } from "path";
9
+ var localRequire = createRequire(import.meta.url);
10
+ var localMapLibreJavaScript;
11
+ var localMapLibreStylesheet;
12
+ var localTileflowBrowserJavaScript;
13
+ var localThreeCoreJavaScript;
14
+ var localThreeModuleJavaScript;
15
+ var localPmtilesJavaScript;
16
+ var localFflateJavaScript;
17
+ function getTileflowPreviewRuntimeResponse(path) {
18
+ if (path === "/__runtime/maplibre-gl.js") {
19
+ return textAssetResponse(getLocalMapLibreAsset("js"), "text/javascript; charset=utf-8");
20
+ }
21
+ if (path === "/__runtime/maplibre-gl.css") {
22
+ return textAssetResponse(getLocalMapLibreAsset("css"), "text/css; charset=utf-8");
23
+ }
24
+ if (path === "/__runtime/tileflow-browser.js") {
25
+ return textAssetResponse(getLocalTileflowBrowserAsset(), "text/javascript; charset=utf-8");
26
+ }
27
+ if (path === "/__runtime/three.module.js") {
28
+ return textAssetResponse(getLocalThreeAsset("module"), "text/javascript; charset=utf-8");
29
+ }
30
+ if (path === "/__runtime/three.core.min.js") {
31
+ return textAssetResponse(getLocalThreeAsset("core"), "text/javascript; charset=utf-8");
32
+ }
33
+ if (path === "/__runtime/pmtiles.js") {
34
+ return textAssetResponse(getLocalPmtilesAsset(), "text/javascript; charset=utf-8");
35
+ }
36
+ if (path === "/__runtime/fflate.js") {
37
+ return textAssetResponse(getLocalFflateAsset(), "text/javascript; charset=utf-8");
38
+ }
39
+ if (path === "/__runtime/three-addons/libs/draco/gltf/draco_decoder.wasm") {
40
+ return binaryAssetResponse(
41
+ getLocalThreeAddonBinaryAsset("libs/draco/gltf/draco_decoder.wasm"),
42
+ "application/wasm"
43
+ );
44
+ }
45
+ if (path.startsWith("/__runtime/three-addons/")) {
46
+ return textAssetResponse(
47
+ getLocalThreeAddonAsset(path.slice("/__runtime/three-addons/".length)),
48
+ "text/javascript; charset=utf-8"
49
+ );
50
+ }
51
+ return void 0;
52
+ }
53
+ function getLocalMapLibreAsset(kind) {
54
+ if (kind === "js" && localMapLibreJavaScript !== void 0) return localMapLibreJavaScript;
55
+ if (kind === "css" && localMapLibreStylesheet !== void 0) return localMapLibreStylesheet;
56
+ const packagePath = localRequire.resolve("maplibre-gl/package.json");
57
+ const source = readFileSync(
58
+ join(dirname(packagePath), "dist", kind === "js" ? "maplibre-gl.js" : "maplibre-gl.css"),
59
+ "utf8"
60
+ );
61
+ if (kind === "js") localMapLibreJavaScript = source;
62
+ else localMapLibreStylesheet = source;
63
+ return source;
64
+ }
65
+ function getLocalTileflowBrowserAsset() {
66
+ if (localTileflowBrowserJavaScript !== void 0) return localTileflowBrowserJavaScript;
67
+ const packagePath = localRequire.resolve("@tileflow/core/package.json");
68
+ localTileflowBrowserJavaScript = readFileSync(
69
+ join(dirname(packagePath), "dist", "browser.js"),
70
+ "utf8"
71
+ );
72
+ return localTileflowBrowserJavaScript;
73
+ }
74
+ function getLocalThreeAsset(kind) {
75
+ if (kind === "core" && localThreeCoreJavaScript !== void 0) return localThreeCoreJavaScript;
76
+ if (kind === "module" && localThreeModuleJavaScript !== void 0)
77
+ return localThreeModuleJavaScript;
78
+ const commonJsPath = localRequire.resolve("three");
79
+ const source = readFileSync(
80
+ join(dirname(commonJsPath), kind === "core" ? "three.core.min.js" : "three.module.min.js"),
81
+ "utf8"
82
+ );
83
+ if (kind === "core") localThreeCoreJavaScript = source;
84
+ else localThreeModuleJavaScript = source;
85
+ return source;
86
+ }
87
+ function getLocalThreeAddonAsset(relativePath) {
88
+ if (!/^[A-Za-z0-9_./-]+\.js$/.test(relativePath) || relativePath.includes("..")) {
89
+ throw new Error("Invalid Three.js addon path.");
90
+ }
91
+ const commonJsPath = localRequire.resolve("three");
92
+ const addonRoot = join(dirname(dirname(commonJsPath)), "examples", "jsm");
93
+ const assetPath = join(addonRoot, relativePath);
94
+ if (!isPathWithin(addonRoot, assetPath)) throw new Error("Invalid Three.js addon path.");
95
+ return readFileSync(assetPath, "utf8");
96
+ }
97
+ function getLocalThreeAddonBinaryAsset(relativePath) {
98
+ if (!/^[A-Za-z0-9_./-]+\.wasm$/.test(relativePath) || relativePath.includes("..")) {
99
+ throw new Error("Invalid Three.js binary addon path.");
100
+ }
101
+ const commonJsPath = localRequire.resolve("three");
102
+ const addonRoot = join(dirname(dirname(commonJsPath)), "examples", "jsm");
103
+ const assetPath = join(addonRoot, relativePath);
104
+ if (!isPathWithin(addonRoot, assetPath)) throw new Error("Invalid Three.js binary addon path.");
105
+ return readFileSync(assetPath);
106
+ }
107
+ function getLocalPmtilesAsset() {
108
+ if (localPmtilesJavaScript !== void 0) return localPmtilesJavaScript;
109
+ const packagePath = localRequire.resolve("pmtiles/package.json");
110
+ localPmtilesJavaScript = readFileSync(
111
+ join(dirname(packagePath), "dist", "esm", "index.js"),
112
+ "utf8"
113
+ );
114
+ return localPmtilesJavaScript;
115
+ }
116
+ function getLocalFflateAsset() {
117
+ if (localFflateJavaScript !== void 0) return localFflateJavaScript;
118
+ const commonJsPath = localRequire.resolve("fflate");
119
+ localFflateJavaScript = readFileSync(
120
+ join(dirname(dirname(commonJsPath)), "esm", "browser.js"),
121
+ "utf8"
122
+ );
123
+ return localFflateJavaScript;
124
+ }
125
+ function textAssetResponse(body, contentType) {
126
+ return new Response(body, {
127
+ headers: {
128
+ "Access-Control-Allow-Origin": "*",
129
+ "Cache-Control": "no-store",
130
+ "Content-Type": contentType
131
+ }
132
+ });
133
+ }
134
+ function binaryAssetResponse(body, contentType) {
135
+ return new Response(new Uint8Array(body), {
136
+ headers: {
137
+ "Access-Control-Allow-Origin": "*",
138
+ "Cache-Control": "no-store",
139
+ "Content-Type": contentType
140
+ }
141
+ });
142
+ }
143
+ export {
144
+ getTileflowPreviewRuntimeResponse
145
+ };
@@ -0,0 +1,69 @@
1
+ import { TileflowStyleFontFace, NormalizedTileflowCaptureScene } from '@tileflow/core';
2
+ import { TileflowBuildCatalog } from '@tileflow/core/build';
3
+
4
+ declare function renderTileflowPreviewHtml(preview: ResolvedTileflowPreview | undefined, basePath: string, initialStatus: unknown, isSemanticPreview: boolean, fontFaces?: readonly TileflowStyleFontFace[]): string;
5
+
6
+ type TileflowLandmarkAxisConvention = 'ENU_Z_UP' | 'EUN_Y_UP' | 'EUS_Y_UP';
7
+ type TileflowLandmarkArchive = {
8
+ bytes: number;
9
+ id: string;
10
+ sha256: string;
11
+ url: string;
12
+ };
13
+ type TileflowLandmarkModel = {
14
+ archive: TileflowLandmarkArchive;
15
+ archiveId: string;
16
+ axisConvention: TileflowLandmarkAxisConvention;
17
+ bytes: number;
18
+ key: string;
19
+ minzoom: number;
20
+ sha256: string;
21
+ x: number;
22
+ y: number;
23
+ z: number;
24
+ };
25
+ type TileflowLandmark = {
26
+ bounds: [number, number, number, number];
27
+ center: [number, number];
28
+ id: string;
29
+ models: TileflowLandmarkModel[];
30
+ priority: number;
31
+ };
32
+ type TileflowLandmarkManifestV2 = {
33
+ archives: TileflowLandmarkArchive[];
34
+ id: string;
35
+ landmarks: TileflowLandmark[];
36
+ maximumCachedModels: number;
37
+ maximumVisibleModels: number;
38
+ minzoom: number;
39
+ schemaVersion: 2;
40
+ };
41
+ /** Reads a response without ever buffering more than the declared bound. */
42
+ declare function readBoundedTileflowResponse(response: Response, maximumBytes: number): Promise<Uint8Array>;
43
+ /** Reads and strictly decodes a bounded UTF-8 JSON response. */
44
+ declare function readBoundedTileflowJsonResponse(response: Response, maximumBytes: number): Promise<unknown>;
45
+ /**
46
+ * Validates the browser preview's bounded v2 PMTiles landmark contract. Keep this function
47
+ * self-contained: the preview serializes it into its isolated browser document.
48
+ */
49
+ declare function normalizeTileflowLandmarkManifest(candidate: unknown, manifestUrl: string): TileflowLandmarkManifestV2;
50
+
51
+ type TileflowPreviewSelection = {
52
+ map?: string;
53
+ scene?: string;
54
+ theme?: string;
55
+ };
56
+ type ResolvedTileflowPreview = {
57
+ camera: NormalizedTileflowCaptureScene['camera'];
58
+ label: string;
59
+ mapName: string;
60
+ themeName: string;
61
+ viewport?: NormalizedTileflowCaptureScene['viewport'];
62
+ };
63
+ declare class TileflowPreviewSelectionError extends Error {
64
+ readonly code: "PREVIEW_SELECTION_INVALID";
65
+ constructor(message: string);
66
+ }
67
+ declare function resolveTileflowPreview(project: TileflowBuildCatalog, selection?: TileflowPreviewSelection): ResolvedTileflowPreview;
68
+
69
+ export { type ResolvedTileflowPreview, type TileflowLandmark, type TileflowLandmarkArchive, type TileflowLandmarkAxisConvention, type TileflowLandmarkManifestV2, type TileflowLandmarkModel, type TileflowPreviewSelection, TileflowPreviewSelectionError, normalizeTileflowLandmarkManifest, readBoundedTileflowJsonResponse, readBoundedTileflowResponse, renderTileflowPreviewHtml, resolveTileflowPreview };
@@ -0,0 +1,18 @@
1
+ import {
2
+ TileflowPreviewSelectionError,
3
+ normalizeTileflowLandmarkManifest,
4
+ readBoundedTileflowJsonResponse,
5
+ readBoundedTileflowResponse,
6
+ renderTileflowPreviewHtml,
7
+ resolveTileflowPreview
8
+ } from "./chunk-MIGBHCXX.js";
9
+ import "./chunk-6MGFMKG3.js";
10
+ import "./chunk-D4OE4ITL.js";
11
+ export {
12
+ TileflowPreviewSelectionError,
13
+ normalizeTileflowLandmarkManifest,
14
+ readBoundedTileflowJsonResponse,
15
+ readBoundedTileflowResponse,
16
+ renderTileflowPreviewHtml,
17
+ resolveTileflowPreview
18
+ };
@@ -0,0 +1,81 @@
1
+ import { TileflowArtifactSession, TileflowArtifactSessionState, TileflowArtifactDiagnostic } from './artifacts.js';
2
+ export { TileflowArtifactAcquisition, TileflowArtifactSessionOptions, createTileflowArtifactDiagnostics, getTileflowAssetBasePath, getTileflowAssetFileName, joinTileflowPublicUrl, normalizeTileflowBasePath, resolveTileflowArtifactPublicUrls, tileflowArtifactSessionSchemaVersion } from './artifacts.js';
3
+ import { IncomingMessage, ServerResponse } from 'node:http';
4
+ import '@tileflow/core';
5
+ import '@tileflow/core/build';
6
+ import '@tileflow/core/manifest';
7
+ import './icons.js';
8
+ import './config.js';
9
+
10
+ declare const tileflowComparisonSchemaVersion: 1;
11
+ type TileflowComparisonRequestHandler = (request: Request) => Promise<Response> | Response;
12
+ type TileflowComparisonSide = {
13
+ /** Route base owned by this side's existing Tileflow dev handler. */
14
+ basePath: string;
15
+ /** Optional safe cwd-relative config argument used by Copy command. */
16
+ captureConfig?: string;
17
+ handler: TileflowComparisonRequestHandler;
18
+ /** Human-readable local label. It is never interpreted as HTML. */
19
+ label: string;
20
+ /** Optional compiler-inspection sidecar exposed by the owning handler. */
21
+ sidecarUrl?: string;
22
+ /** Same-origin preview URL below basePath, including its map/theme query. */
23
+ previewUrl: string;
24
+ };
25
+ type TileflowComparisonMode = 'blink' | 'overlay' | 'side-by-side' | 'split';
26
+ type TileflowComparisonOptions = {
27
+ basePath?: string;
28
+ initialMode?: TileflowComparisonMode;
29
+ left: TileflowComparisonSide;
30
+ right: TileflowComparisonSide;
31
+ title?: string;
32
+ };
33
+ /**
34
+ * Compose two existing Tileflow dev handlers behind one same-origin comparison shell.
35
+ *
36
+ * The side handlers retain ownership of styles, sprites, fonts, generations, live
37
+ * events, and last-known-good behavior. This router owns only the shell document and
38
+ * deterministic dispatch by route prefix.
39
+ */
40
+ declare function createTileflowComparisonRequestHandler(options: TileflowComparisonOptions): (request: Request) => Promise<Response>;
41
+
42
+ type TileflowDevRequestHandlerOptions = {
43
+ apiBaseUrl?: string;
44
+ basePath?: string;
45
+ config?: string;
46
+ cwd?: string;
47
+ inspection?: boolean;
48
+ map?: string;
49
+ onError?: (error: unknown) => void;
50
+ scene?: string;
51
+ session?: TileflowArtifactSession;
52
+ styleBaseUrl?: string;
53
+ theme?: string;
54
+ };
55
+ type TileflowDevRequestHandler = ((request: Request) => Promise<Response>) & {
56
+ close(): Promise<void>;
57
+ refresh(): Promise<void>;
58
+ };
59
+ declare function getTileflowStyleSelection(path: string): {
60
+ mapName: string;
61
+ themeName: string;
62
+ } | undefined;
63
+ declare function getTileflowStyleInspectionSelection(path: string): {
64
+ mapName: string;
65
+ themeName: string;
66
+ } | undefined;
67
+ declare function isTileflowRequestUrl(url: string | undefined, basePath: string): boolean;
68
+ /** Match and strip the configured route base using the same route table as the request handler. */
69
+ declare function getTileflowRequestPath(url: string | undefined, basePath: string): string | null;
70
+ declare function createTileflowNodeRequest(request: IncomingMessage): Request;
71
+ declare function writeTileflowNodeResponse(response: ServerResponse, tileflowResponse: Response): Promise<void>;
72
+ declare function createTileflowDevRequestHandler(options?: TileflowDevRequestHandlerOptions): TileflowDevRequestHandler;
73
+ declare function createTileflowArtifactStatus(state: TileflowArtifactSessionState): {
74
+ diagnostics?: TileflowArtifactDiagnostic[] | undefined;
75
+ lastGoodGeneration?: number | undefined;
76
+ schemaVersion: 1;
77
+ generation: number;
78
+ status: "ready" | "building" | "invalid";
79
+ };
80
+
81
+ export { TileflowArtifactDiagnostic, TileflowArtifactSession, TileflowArtifactSessionState, type TileflowComparisonMode, type TileflowComparisonOptions, type TileflowComparisonRequestHandler, type TileflowComparisonSide, type TileflowDevRequestHandler, type TileflowDevRequestHandlerOptions, createTileflowArtifactStatus, createTileflowComparisonRequestHandler, createTileflowDevRequestHandler, createTileflowNodeRequest, getTileflowRequestPath, getTileflowStyleInspectionSelection, getTileflowStyleSelection, isTileflowRequestUrl, tileflowComparisonSchemaVersion, writeTileflowNodeResponse };
package/dist/server.js ADDED
@@ -0,0 +1,48 @@
1
+ import {
2
+ createTileflowArtifactStatus,
3
+ createTileflowComparisonRequestHandler,
4
+ createTileflowDevRequestHandler,
5
+ createTileflowNodeRequest,
6
+ getTileflowRequestPath,
7
+ getTileflowStyleInspectionSelection,
8
+ getTileflowStyleSelection,
9
+ isTileflowRequestUrl,
10
+ tileflowComparisonSchemaVersion,
11
+ writeTileflowNodeResponse
12
+ } from "./chunk-KH7CMHT3.js";
13
+ import {
14
+ createTileflowArtifactDiagnostics,
15
+ tileflowArtifactSessionSchemaVersion
16
+ } from "./chunk-XTRHREXO.js";
17
+ import "./chunk-ONYQNLNA.js";
18
+ import {
19
+ getTileflowAssetBasePath,
20
+ getTileflowAssetFileName,
21
+ joinTileflowPublicUrl,
22
+ normalizeTileflowBasePath,
23
+ resolveTileflowArtifactPublicUrls
24
+ } from "./chunk-RSBV4L2Y.js";
25
+ import "./chunk-CENQR5Q2.js";
26
+ import "./chunk-BL3FK4GO.js";
27
+ import "./chunk-KDFTE4Q5.js";
28
+ import "./chunk-6MGFMKG3.js";
29
+ import "./chunk-D4OE4ITL.js";
30
+ export {
31
+ createTileflowArtifactDiagnostics,
32
+ createTileflowArtifactStatus,
33
+ createTileflowComparisonRequestHandler,
34
+ createTileflowDevRequestHandler,
35
+ createTileflowNodeRequest,
36
+ getTileflowAssetBasePath,
37
+ getTileflowAssetFileName,
38
+ getTileflowRequestPath,
39
+ getTileflowStyleInspectionSelection,
40
+ getTileflowStyleSelection,
41
+ isTileflowRequestUrl,
42
+ joinTileflowPublicUrl,
43
+ normalizeTileflowBasePath,
44
+ resolveTileflowArtifactPublicUrls,
45
+ tileflowArtifactSessionSchemaVersion,
46
+ tileflowComparisonSchemaVersion,
47
+ writeTileflowNodeResponse
48
+ };
@@ -0,0 +1,94 @@
1
+ declare const inspectionLimits: Readonly<{
2
+ maxBytes: 24000000;
3
+ maxDistinctValuesPerField: 256;
4
+ maxFeatures: 20000;
5
+ maxIncludedValueFields: 32;
6
+ maxTiles: 8;
7
+ maxValueLength: 256;
8
+ maxValuesPerField: 16;
9
+ }>;
10
+ type TileCoordinate = Readonly<{
11
+ x: number;
12
+ y: number;
13
+ z: number;
14
+ }>;
15
+ type FieldType = 'Boolean' | 'Number' | 'String';
16
+ type FieldValue = boolean | number | string;
17
+ type TileflowTilesetInspectionWarning = Readonly<{
18
+ code: string;
19
+ message: string;
20
+ path: string;
21
+ }>;
22
+ type TileflowTilesetInspectionV1 = Readonly<{
23
+ schemaVersion: 1;
24
+ contract: Readonly<{
25
+ authority: 'pmtiles-header-and-tilejson-v1';
26
+ attribution?: string;
27
+ bounds: readonly [number, number, number, number];
28
+ center: readonly [number, number, number];
29
+ counts: Readonly<{
30
+ addressedTiles: number;
31
+ declaredTileContents: number | null;
32
+ tileEntries: number;
33
+ }>;
34
+ maxzoom: number;
35
+ minzoom: number;
36
+ sourceLayersDeclared: boolean;
37
+ sourceLayers: readonly Readonly<{
38
+ fieldsDeclared: boolean;
39
+ fields: readonly Readonly<{
40
+ name: string;
41
+ type?: FieldType;
42
+ }>[];
43
+ id: string;
44
+ maxzoom?: number;
45
+ minzoom?: number;
46
+ }>[];
47
+ tileType: 'avif' | 'jpeg' | 'mlt' | 'mvt' | 'png' | 'webp';
48
+ }>;
49
+ observation?: Readonly<{
50
+ authority: 'bounded-mvt-sample-v1';
51
+ featuresRead: number;
52
+ includedValueFields: readonly string[];
53
+ limits: typeof inspectionLimits;
54
+ sourceLayers: readonly Readonly<{
55
+ featuresRead: number;
56
+ fields: readonly Readonly<{
57
+ distinctValuesObserved: number;
58
+ distinctValuesTruncated: boolean;
59
+ featuresMissing: number;
60
+ featuresPresent: number;
61
+ name: string;
62
+ numericRange?: Readonly<{
63
+ max: number;
64
+ min: number;
65
+ }>;
66
+ observedValues?: readonly Readonly<{
67
+ count: number;
68
+ value: FieldValue;
69
+ }>[];
70
+ observedValuesTruncated?: boolean;
71
+ types: readonly FieldType[];
72
+ }>[];
73
+ geometryTypes: readonly string[];
74
+ id: string;
75
+ }>[];
76
+ tiles: readonly TileCoordinate[];
77
+ tilesRead: number;
78
+ truncated: boolean;
79
+ }>;
80
+ warnings: readonly TileflowTilesetInspectionWarning[];
81
+ }>;
82
+ type TileflowLocalTilesetInspection = Readonly<{
83
+ contract: Pick<TileflowTilesetInspectionV1['contract'], 'sourceLayers' | 'sourceLayersDeclared' | 'tileType'>;
84
+ warnings: readonly TileflowTilesetInspectionWarning[];
85
+ }>;
86
+ declare function inspectTileflowPmtilesForLocalUse(archivePath: string): Promise<TileflowLocalTilesetInspection>;
87
+ declare function inspectTileflowPmtiles(archivePath: string, options?: {
88
+ includeValues?: readonly string[];
89
+ maximumDirectoryDepth?: number;
90
+ sample?: boolean;
91
+ signal?: AbortSignal;
92
+ }): Promise<TileflowTilesetInspectionV1>;
93
+
94
+ export { type TileflowLocalTilesetInspection as T, type TileflowTilesetInspectionV1 as a, type TileflowTilesetInspectionWarning as b, inspectTileflowPmtilesForLocalUse as c, inspectTileflowPmtiles as i };
@@ -0,0 +1 @@
1
+ export { a as TileflowTilesetInspectionV1, b as TileflowTilesetInspectionWarning, i as inspectTileflowPmtiles } from './tilesets-C0tGeenP.js';
@@ -0,0 +1,6 @@
1
+ import {
2
+ inspectTileflowPmtiles
3
+ } from "./chunk-ONYQNLNA.js";
4
+ export {
5
+ inspectTileflowPmtiles
6
+ };
@@ -0,0 +1,63 @@
1
+ import { MapLibreStyle } from '@tileflow/core';
2
+
3
+ declare function sanitizeDiagnosticSecrets(value: string): string;
4
+
5
+ type TileflowStyleValidationIssue = {
6
+ map: string;
7
+ message: string;
8
+ path: string;
9
+ };
10
+ declare class TileflowStyleValidationError extends Error {
11
+ readonly code: "STYLE_INVALID";
12
+ readonly issues: TileflowStyleValidationIssue[];
13
+ readonly phase: "style-validation";
14
+ constructor(issues: readonly TileflowStyleValidationIssue[]);
15
+ }
16
+ declare function assertValidTileflowStyle(style: MapLibreStyle, map: string): void;
17
+ declare function validateTileflowStyle(style: MapLibreStyle, map: string): TileflowStyleValidationIssue[];
18
+
19
+ declare const tileflowCommandDocumentSchemaVersion: 1;
20
+ type TileflowDiagnosticSeverity = 'error' | 'info' | 'warning';
21
+ /** Stable, bounded diagnostic contract intended for tools and coding agents. */
22
+ type TileflowStructuredDiagnostic = {
23
+ phase: string;
24
+ code: string;
25
+ /** Semantic compiler domain. Legacy `owner` inputs are normalized to this field. */
26
+ domain?: string;
27
+ path: string;
28
+ /** Semantic compiler target, when the diagnostic applies to one render contribution. */
29
+ target?: string;
30
+ severity: TileflowDiagnosticSeverity;
31
+ message: string;
32
+ suggestion: string;
33
+ };
34
+ type TileflowCommandSummary = TileflowStructuredDiagnostic & {
35
+ schemaVersion: typeof tileflowCommandDocumentSchemaVersion;
36
+ command: string;
37
+ ok: boolean;
38
+ };
39
+ type TileflowCommandFailureDocument = TileflowCommandSummary & {
40
+ ok: false;
41
+ diagnostics: TileflowStructuredDiagnostic[];
42
+ };
43
+ type TileflowDiagnosticDefaults = {
44
+ code: string;
45
+ phase: string;
46
+ severity?: TileflowDiagnosticSeverity;
47
+ };
48
+ declare function createTileflowCommandSummary(input: {
49
+ code: string;
50
+ command: string;
51
+ message: string;
52
+ ok: boolean;
53
+ path?: string;
54
+ phase: string;
55
+ severity: TileflowDiagnosticSeverity;
56
+ suggestion: string;
57
+ }): TileflowCommandSummary;
58
+ /** Convert arbitrary SDK failures to sorted diagnostics without leaking paths, URLs, or secrets. */
59
+ declare function createTileflowStructuredDiagnostics(error: unknown, cwd: string, defaults: TileflowDiagnosticDefaults): TileflowStructuredDiagnostic[];
60
+ declare function createTileflowCommandFailureDocument(command: string, error: unknown, cwd: string, defaults: TileflowDiagnosticDefaults): TileflowCommandFailureDocument;
61
+ declare function serializeTileflowCommandDocument(value: unknown): string;
62
+
63
+ export { type TileflowCommandFailureDocument, type TileflowCommandSummary, type TileflowDiagnosticSeverity, type TileflowStructuredDiagnostic, TileflowStyleValidationError, type TileflowStyleValidationIssue, assertValidTileflowStyle, createTileflowCommandFailureDocument, createTileflowCommandSummary, createTileflowStructuredDiagnostics, sanitizeDiagnosticSecrets, serializeTileflowCommandDocument, tileflowCommandDocumentSchemaVersion, validateTileflowStyle };
@@ -0,0 +1,24 @@
1
+ import {
2
+ createTileflowCommandFailureDocument,
3
+ createTileflowCommandSummary,
4
+ createTileflowStructuredDiagnostics,
5
+ serializeTileflowCommandDocument,
6
+ tileflowCommandDocumentSchemaVersion
7
+ } from "./chunk-LNCTVFUD.js";
8
+ import {
9
+ TileflowStyleValidationError,
10
+ assertValidTileflowStyle,
11
+ sanitizeDiagnosticSecrets,
12
+ validateTileflowStyle
13
+ } from "./chunk-KDFTE4Q5.js";
14
+ export {
15
+ TileflowStyleValidationError,
16
+ assertValidTileflowStyle,
17
+ createTileflowCommandFailureDocument,
18
+ createTileflowCommandSummary,
19
+ createTileflowStructuredDiagnostics,
20
+ sanitizeDiagnosticSecrets,
21
+ serializeTileflowCommandDocument,
22
+ tileflowCommandDocumentSchemaVersion,
23
+ validateTileflowStyle
24
+ };