@tileflow/capture 0.1.0-alpha.28 → 0.1.0-alpha.30
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/README.md +63 -3
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/{chunk-BSTB4FN6.js → chunk-BI5PWIH4.js} +276 -99
- package/dist/index.d.ts +78 -19
- package/dist/index.js +992 -139
- package/dist/receipt-CfZkzyXd.d.ts +222 -0
- package/dist/receipt.d.ts +1 -1
- package/dist/receipt.js +15 -3
- package/docs/receipts-and-comparison.md +9 -2
- package/package.json +16 -16
- package/dist/receipt-Q7wQ68tG.d.ts +0 -160
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Browser } from 'playwright';
|
|
2
|
-
import { T as TileflowCaptureRendererIdentity, a as
|
|
3
|
-
export { C as CreateTileflowCaptureReceiptInput, e as
|
|
4
|
-
import { TileflowCaptureScene, MapLibreStyle, NormalizedTileflowCaptureScene } from '@tileflow/core';
|
|
5
|
-
import { TileflowIconResolutionOptions, TileflowBuildArtifacts
|
|
2
|
+
import { T as TileflowCaptureRendererIdentity, a as TileflowShotReceiptV1, b as TileflowCaptureReceipt, c as TileflowCaptureDataInput, d as TileflowCaptureWorldIdentity } from './receipt-CfZkzyXd.js';
|
|
3
|
+
export { C as CreateTileflowCaptureReceiptInput, e as CreateTileflowShotReceiptInput, f as TileflowCaptureDataBindings, g as TileflowCaptureDataCapabilities, h as TileflowCaptureDataIdentity, i as TileflowCaptureDataSemantics, j as TileflowCaptureDataSource, k as TileflowCaptureVectorIdentity, l as TileflowCaptureVerification, m as createTileflowCaptureReceipt, n as createTileflowCaptureRendererIdentity, o as createTileflowShotReceipt, p as parseTileflowCaptureReceipt, q as parseTileflowShotReceipt, s as serializeTileflowCaptureReceipt, r as serializeTileflowShotReceipt, t as tileflowCaptureReceiptLimits, u as tileflowCaptureReceiptSchemaVersion, v as tileflowCaptureRuntime, w as tileflowShotReceiptLimits, x as tileflowShotReceiptSchemaVersion, y as validateTileflowCaptureReceipt, z as validateTileflowShotReceipt } from './receipt-CfZkzyXd.js';
|
|
4
|
+
import { NormalizedTileflowCaptureShot, TileflowCaptureScene, MapLibreStyle, NormalizedTileflowCaptureScene } from '@tileflow/core';
|
|
5
|
+
import { TileflowBuildAsset, TileflowIconResolutionOptions, TileflowBuildArtifacts } from '@tileflow/dev/artifacts';
|
|
6
6
|
|
|
7
7
|
type TileflowBrowserInstallProgress = 'installing' | 'installed';
|
|
8
8
|
type TileflowBrowserLaunchOptions = {
|
|
@@ -24,6 +24,49 @@ declare class TileflowCaptureBrowserManager {
|
|
|
24
24
|
close(): Promise<void>;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
declare const tileflowSyntheticAssetOrigin = "https://tileflow.local.invalid";
|
|
28
|
+
type TileflowCaptureAsset = TileflowBuildAsset & {
|
|
29
|
+
url?: string;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
type TileflowShotVideoCodec = 'vp8' | 'vp9';
|
|
33
|
+
|
|
34
|
+
type TileflowShotFormat = 'frames' | 'webm';
|
|
35
|
+
/** One rendered frame, delivered in order while a shot renders. */
|
|
36
|
+
type TileflowShotFrame = {
|
|
37
|
+
shot: string;
|
|
38
|
+
index: number;
|
|
39
|
+
png: Uint8Array;
|
|
40
|
+
sha256: string;
|
|
41
|
+
};
|
|
42
|
+
type TileflowShotCapture = {
|
|
43
|
+
shot: string;
|
|
44
|
+
map: string;
|
|
45
|
+
theme: string;
|
|
46
|
+
format: TileflowShotFormat;
|
|
47
|
+
/** WebM bytes for the `webm` format. Frames reach `onFrame` and are not retained. */
|
|
48
|
+
video?: Uint8Array;
|
|
49
|
+
codec?: TileflowShotVideoCodec;
|
|
50
|
+
/** SHA-256 of the video, or of the frame set (`framesSha256`) for the `frames` format. */
|
|
51
|
+
sha256: string;
|
|
52
|
+
framesSha256: string;
|
|
53
|
+
frameSha256s: string[];
|
|
54
|
+
shotSha256: string;
|
|
55
|
+
styleSha256: string;
|
|
56
|
+
fps: NormalizedTileflowCaptureShot['fps'];
|
|
57
|
+
frameCount: number;
|
|
58
|
+
durationMs: number;
|
|
59
|
+
width: number;
|
|
60
|
+
height: number;
|
|
61
|
+
dpr: 1 | 2;
|
|
62
|
+
networkDependent: boolean;
|
|
63
|
+
renderer: TileflowCaptureRendererIdentity;
|
|
64
|
+
receipt: TileflowShotReceiptV1;
|
|
65
|
+
warnings: string[];
|
|
66
|
+
};
|
|
67
|
+
/** SHA-256 of each frame's PNG SHA-256 in lowercase hex, one per line, in frame order. */
|
|
68
|
+
declare function tileflowShotFramesSha256(frameSha256s: readonly string[]): Promise<string>;
|
|
69
|
+
|
|
27
70
|
declare const tileflowCaptureResultSchemaVersion: 1;
|
|
28
71
|
type TileflowCaptureOptions = {
|
|
29
72
|
allowBrowserInstall?: boolean;
|
|
@@ -61,25 +104,46 @@ type TileflowCapture = {
|
|
|
61
104
|
networkDependent: boolean;
|
|
62
105
|
renderer: TileflowCaptureRendererIdentity;
|
|
63
106
|
/** Newly captured evidence is always the concrete-theme receipt contract. */
|
|
64
|
-
receipt:
|
|
107
|
+
receipt: TileflowCaptureReceipt;
|
|
65
108
|
warnings: string[];
|
|
66
109
|
};
|
|
67
110
|
type TileflowCaptureResult = {
|
|
68
111
|
schemaVersion: 1;
|
|
69
112
|
captures: TileflowCapture[];
|
|
70
113
|
};
|
|
114
|
+
type TileflowShotCaptureOptions = {
|
|
115
|
+
/** `webm` (the default) encodes a VP9 or VP8 video; `frames` delivers only PNG frames. */
|
|
116
|
+
format?: TileflowShotFormat;
|
|
117
|
+
/** Receives each frame's PNG in order while the shot renders. */
|
|
118
|
+
onFrame?: (frame: TileflowShotFrame) => Promise<void> | void;
|
|
119
|
+
signal?: AbortSignal;
|
|
120
|
+
};
|
|
121
|
+
type TileflowShotCaptureResult = {
|
|
122
|
+
schemaVersion: 1;
|
|
123
|
+
shots: TileflowShotCapture[];
|
|
124
|
+
};
|
|
125
|
+
type CaptureTileflowShotOptions = CreateTileflowCaptureSessionOptions & Omit<TileflowShotCaptureOptions, 'signal'> & {
|
|
126
|
+
shot: string;
|
|
127
|
+
};
|
|
71
128
|
type TileflowCaptureSession = {
|
|
72
129
|
capture(scenes: string[], signal?: AbortSignal): Promise<TileflowCaptureResult>;
|
|
73
130
|
captureAll(signal?: AbortSignal): Promise<TileflowCaptureResult>;
|
|
74
131
|
captureDefinitions(scenes: Record<string, TileflowCaptureScene>, signal?: AbortSignal): Promise<TileflowCaptureResult>;
|
|
75
132
|
captureArtifacts(artifacts: TileflowBuildArtifacts, requestedScenes: string[], signal?: AbortSignal): Promise<TileflowCaptureResult>;
|
|
133
|
+
/** Renders one committed shot. */
|
|
134
|
+
captureShot(shot: string, options?: TileflowShotCaptureOptions): Promise<TileflowShotCapture>;
|
|
135
|
+
/** Renders committed shots in name order from one compiled artifact snapshot. */
|
|
136
|
+
captureShots(shots: string[], options?: TileflowShotCaptureOptions): Promise<TileflowShotCaptureResult>;
|
|
137
|
+
captureAllShots(options?: TileflowShotCaptureOptions): Promise<TileflowShotCaptureResult>;
|
|
76
138
|
close(): Promise<void>;
|
|
77
139
|
};
|
|
78
140
|
declare function captureTileflowScenes(options: TileflowCaptureOptions): Promise<TileflowCaptureResult>;
|
|
141
|
+
/** Renders one committed shot with a temporary session. */
|
|
142
|
+
declare function captureTileflowShot(options: CaptureTileflowShotOptions): Promise<TileflowShotCapture>;
|
|
79
143
|
declare function createTileflowCaptureSession(options?: CreateTileflowCaptureSessionOptions): TileflowCaptureSession;
|
|
80
144
|
|
|
81
|
-
type TileflowCaptureErrorCode = 'ABORTED' | 'APPLICATION_ORIGIN_REQUIRED' | 'APPLICATION_ORIGIN_INVALID' | 'APPLICATION_NAVIGATION_FAILED' | 'APPLICATION_TARGET_NOT_FOUND' | 'APPLICATION_TARGET_AMBIGUOUS' | 'APPLICATION_ERROR' | 'BASELINE_INVALID' | 'BROWSER_INSTALL_FAILED' | 'BROWSER_MISSING' | 'BROWSER_START_FAILED' | 'CAPTURE_TIMEOUT' | 'INVALID_PNG' | 'MAP_LOAD_FAILED' | 'RENDER_FAILED' | 'RESOURCE_FAILED' | 'SCENE_NOT_FOUND' | 'SCREENSHOT_FAILED' | 'STYLE_INVALID' | 'SYNTHETIC_ASSET_NOT_FOUND' | 'WORLD_RESOLUTION_FAILED';
|
|
82
|
-
type TileflowCapturePhase = 'style-validation' | 'browser-start' | 'resource-load' | 'map-load' | 'map-idle' | 'screenshot';
|
|
145
|
+
type TileflowCaptureErrorCode = 'ABORTED' | 'APPLICATION_ORIGIN_REQUIRED' | 'APPLICATION_ORIGIN_INVALID' | 'APPLICATION_NAVIGATION_FAILED' | 'APPLICATION_TARGET_NOT_FOUND' | 'APPLICATION_TARGET_AMBIGUOUS' | 'APPLICATION_ERROR' | 'BASELINE_INVALID' | 'BROWSER_INSTALL_FAILED' | 'BROWSER_MISSING' | 'BROWSER_START_FAILED' | 'CAPTURE_TIMEOUT' | 'INVALID_PNG' | 'MAP_LOAD_FAILED' | 'RENDER_FAILED' | 'RESOURCE_FAILED' | 'SCENE_NOT_FOUND' | 'SCREENSHOT_FAILED' | 'SHOT_NOT_FOUND' | 'STYLE_INVALID' | 'SYNTHETIC_ASSET_NOT_FOUND' | 'VIDEO_ENCODE_FAILED' | 'VIDEO_ENCODER_UNAVAILABLE' | 'WORLD_RESOLUTION_FAILED';
|
|
146
|
+
type TileflowCapturePhase = 'style-validation' | 'browser-start' | 'resource-load' | 'map-load' | 'theme-blend' | 'map-idle' | 'screenshot' | 'video-encode';
|
|
83
147
|
type TileflowCaptureDiagnostic = {
|
|
84
148
|
message: string;
|
|
85
149
|
path: string;
|
|
@@ -106,11 +170,6 @@ declare class TileflowCaptureError extends Error {
|
|
|
106
170
|
}
|
|
107
171
|
declare function captureErrorMessage(error: unknown, fallback: string): string;
|
|
108
172
|
|
|
109
|
-
declare const tileflowSyntheticAssetOrigin = "https://tileflow.local.invalid";
|
|
110
|
-
type TileflowCaptureAsset = TileflowBuildAsset & {
|
|
111
|
-
url?: string;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
173
|
declare const tileflowWorldCurrentTileJsonUrl: "https://api.tileflow.dev/tiles/world/tiles.json";
|
|
115
174
|
type FetchTileJson = (input: string, init: {
|
|
116
175
|
cache: 'no-store';
|
|
@@ -118,7 +177,7 @@ type FetchTileJson = (input: string, init: {
|
|
|
118
177
|
signal?: AbortSignal;
|
|
119
178
|
}) => Promise<Pick<Response, 'ok' | 'status' | 'text'>>;
|
|
120
179
|
type TileflowCaptureResolvedWorldV1 = Readonly<{
|
|
121
|
-
identity: Omit<
|
|
180
|
+
identity: Omit<TileflowCaptureWorldIdentity, 'kind' | 'schema' | 'schemaVersion' | 'semantics' | 'sourceId'>;
|
|
122
181
|
tileJsonUrl: string;
|
|
123
182
|
tileJson: string;
|
|
124
183
|
tiles: readonly [string];
|
|
@@ -321,13 +380,13 @@ type TileflowVisualReviewFrameIdentity = {
|
|
|
321
380
|
};
|
|
322
381
|
};
|
|
323
382
|
type TileflowVisualReviewSide = {
|
|
324
|
-
scene:
|
|
325
|
-
style:
|
|
383
|
+
scene: TileflowCaptureReceipt['scene'];
|
|
384
|
+
style: TileflowCaptureReceipt['style'];
|
|
326
385
|
frame: TileflowVisualReviewFrameIdentity;
|
|
327
386
|
image: TileflowVisualImageIdentity;
|
|
328
|
-
runtime: Pick<
|
|
329
|
-
data:
|
|
330
|
-
verification:
|
|
387
|
+
runtime: Pick<TileflowCaptureReceipt, 'renderer' | 'platform'>;
|
|
388
|
+
data: TileflowCaptureReceipt['data'];
|
|
389
|
+
verification: TileflowCaptureReceipt['verification'];
|
|
331
390
|
palette: TileflowVisualPaletteColor[];
|
|
332
391
|
};
|
|
333
392
|
type TileflowVisualReviewComparison = {
|
|
@@ -365,4 +424,4 @@ declare const tileflowVisualReviewLimits: Readonly<{
|
|
|
365
424
|
maximumAggregatePngBytes: number;
|
|
366
425
|
}>;
|
|
367
426
|
|
|
368
|
-
export { type CreateTileflowCaptureSessionOptions, type PreparedTileflowCaptureStyle, type TileflowBrowserInstallProgress, type TileflowBrowserLaunchOptions, type TileflowCapture, TileflowCaptureBrowserManager, TileflowCaptureDataInput, type TileflowCaptureDiagnostic, TileflowCaptureError, type TileflowCaptureErrorCode, type TileflowCaptureErrorDetails, type TileflowCaptureOptions, type TileflowCapturePhase, TileflowCaptureReceipt,
|
|
427
|
+
export { type CaptureTileflowShotOptions, type CreateTileflowCaptureSessionOptions, type PreparedTileflowCaptureStyle, type TileflowBrowserInstallProgress, type TileflowBrowserLaunchOptions, type TileflowCapture, TileflowCaptureBrowserManager, TileflowCaptureDataInput, type TileflowCaptureDiagnostic, TileflowCaptureError, type TileflowCaptureErrorCode, type TileflowCaptureErrorDetails, type TileflowCaptureOptions, type TileflowCapturePhase, TileflowCaptureReceipt, TileflowCaptureRendererIdentity, type TileflowCaptureResolvedWorldV1, type TileflowCaptureResourceDiagnostic, type TileflowCaptureResourceKind, type TileflowCaptureResult, type TileflowCaptureSession, TileflowCaptureWorldIdentity, TileflowCaptureWorldSession, type TileflowShotCapture, type TileflowShotCaptureOptions, type TileflowShotCaptureResult, type TileflowShotFormat, type TileflowShotFrame, TileflowShotReceiptV1, type TileflowShotVideoCodec, type TileflowVisualAppearanceDelta, type TileflowVisualAppearanceProfile, type TileflowVisualAppearanceStatistics, type TileflowVisualBaseline, type TileflowVisualComparison, type TileflowVisualComparisonDocument, type TileflowVisualComparisonStatus, type TileflowVisualImageIdentity, type TileflowVisualPaletteColor, type TileflowVisualPixelMetric, type TileflowVisualReferenceAnalysis, type TileflowVisualReferenceAnalysisDocument, type TileflowVisualReferenceAnalysisOptions, type TileflowVisualReferenceAppearance, type TileflowVisualRegion, type TileflowVisualReviewAppearance, type TileflowVisualReviewCapture, type TileflowVisualReviewComparison, type TileflowVisualReviewDefinition, type TileflowVisualReviewDocument, TileflowVisualReviewError, type TileflowVisualReviewFrameIdentity, type TileflowVisualReviewOptions, type TileflowVisualReviewSide, type TileflowVisualReviewStatus, type TileflowVisualRuntimeIdentity, type TileflowVisualSceneIdentity, analyzeTileflowCaptureReference, captureErrorMessage, captureTileflowScenes, captureTileflowShot, compareTileflowCaptureToBaseline, compareTileflowCapturesForReview, createTileflowCaptureBrowserEnvironment, createTileflowCaptureSession, createTileflowVisualComparisonDocument, createTileflowVisualReferenceAnalysisDocument, createTileflowVisualReviewDocument, launchTileflowCaptureBrowser, resolveTileflowApplicationUrl, resolveTileflowCaptureWorldTileJson, serializeTileflowVisualComparison, setupTileflowCaptureBrowser, tileflowCaptureResultSchemaVersion, tileflowShotFramesSha256, tileflowSyntheticAssetOrigin, tileflowVisualArtifactLimits, tileflowVisualComparisonSchemaVersion, tileflowVisualEdgeThreshold, tileflowVisualPerceptualThreshold, tileflowVisualReviewLimits, tileflowVisualReviewSchemaVersion, tileflowWorldCurrentTileJsonUrl, validateTileflowVisualReferencePng };
|