tileflow 0.1.0-alpha.12 → 0.1.0-alpha.14

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.
@@ -184,8 +184,19 @@ Hosted deploy currently rejects local or package-owned web fonts before authenti
184
184
  writes. Use self-hosted delivery or an explicit public glyph provider. Enabling managed font bundles
185
185
  requires a separately deployed ownership, quota, retention, and immutable-delivery contract.
186
186
 
187
- For both managed resource kinds, `assetSetSha256` remains a separate per-map output identity. It
187
+ A map's own 3D building models (the building models of its `models` directories) deploy as one
188
+ model bundle per map. Deploy prepares them as `build` does, uploads the bundle with
189
+ `PUT /v1/model-bundles/:contentHash` after authentication and before the first style write, compiles
190
+ each placement's `url` at the bundle's hosted address and publishes the style with the bundle's
191
+ content hash. Byte-identical bundles are reused by content hash. A bundle holds at most 64 models,
192
+ 16 MiB a prepared file and 32 MiB together, and shares the organization's hosted-storage pool like
193
+ icon packages. Upload success must confirm the submitted `contentHash`, model count and byte total,
194
+ one opaque `mdb_<id>` and the query-free `/model-bundles/<id>` base URL. A deploy with
195
+ `--with-native` rejects a map's own building models, because MapLibre Native draws no models.
196
+
197
+ For every managed resource kind, `assetSetSha256` remains a separate per-map output identity. It
188
198
  hashes each generated file's exact portable name, media type, byte count, and SHA-256 using Core's
189
199
  asset-set v1 contract; it does not hash only the icon-package manifest. Hosted must
190
200
  confirm the immutable resource bytes, reconstruct those same per-file identities (including the
191
- `icons/<mapId>/` prefix), and reject the Style when the submitted build-manifest hash diverges.
201
+ `icons/<mapId>/` and `models/<mapId>/` prefixes), and reject the Style when the submitted
202
+ build-manifest hash diverges.
@@ -54,7 +54,7 @@ export default defineMap({
54
54
  cartographic compiler; tooling supplies the exported map ID when it normalizes a scene internally.
55
55
  Every scene stores a concrete theme; omission and browser-only `system` are invalid.
56
56
 
57
- ### Live comparison workbench
57
+ ### Live comparison in Map DevTools
58
58
 
59
59
  Use the ordinary preview server with a right-hand selection to compare two maps or themes while
60
60
  authoring:
@@ -62,8 +62,8 @@ authoring:
62
62
  ```sh
63
63
  # Two maps or themes from one config.
64
64
  npx tileflow preview \
65
- --map harad --theme light \
66
- --against-map ferraris --against-theme light
65
+ --map baedeker --theme light \
66
+ --against-map map-1777 --against-theme light
67
67
 
68
68
  # Or compare against another config.
69
69
  npx tileflow preview \
@@ -71,7 +71,7 @@ npx tileflow preview \
71
71
  --against-config ./reference.config.ts --against-map reference
72
72
  ```
73
73
 
74
- Any `--against-*` option opens the comparison workbench. Both previews remain same-origin and share
74
+ Any `--against-*` option opens Map DevTools in comparison mode. Both previews remain same-origin and share
75
75
  one synchronized camera. The toolbar switches between side-by-side, split, opacity overlay, and
76
76
  blink modes; the selected mode, camera, split, opacity, and active interaction side survive in the
77
77
  URL. Each config has its own watched, last-known-good session, so an invalid edit shows bounded
@@ -81,7 +81,7 @@ Enable **Inspect** and click a rendered feature to see its bounded feature data,
81
81
  zoom-curve samples, and compiler contribution sidecar. The sprite gallery shows the compiled atlas,
82
82
  not source directories. **Copy scene** produces a concrete-theme scene for the current camera and
83
83
  viewport; **Copy command** produces the corresponding capture command. The inspector sidecar exists
84
- only in memory in this local workbench and is not emitted by `tileflow build`.
84
+ only in memory in the local Map DevTools session and is not emitted by `tileflow build`.
85
85
 
86
86
  ### Reproducible two-style review
87
87
 
@@ -0,0 +1,132 @@
1
+ # Map authoring workflow
2
+
3
+ Install the CLI and your map's dependencies in your project as described in the
4
+ [CLI guide](https://github.com/tileflow/tileflow-sdk/blob/main/packages/cli/README.md).
5
+ Run these commands from that project directory, with a trusted `tileflow.config.ts`.
6
+ Discovery and saved-capture comparison also work without a config.
7
+
8
+ ## Discover the language and inspect a change
9
+
10
+ Use four primary command groups for map development:
11
+
12
+ | Command | Purpose |
13
+ | ---------- | -------------------------------------------------------------------------------------------------------------------------------------- |
14
+ | `describe` | Discover the generated language and query one domain or schema fragment. |
15
+ | `inspect` | Read resolved configuration; `compiled`, `features`, `icons`, and `tileset` inspect output/data; `session` reads Map DevTools context. |
16
+ | `capture` | Render reproducible evidence and return a reusable capture ID. |
17
+ | `compare` | Compare saved capture IDs; `configs`, `styles`, `reference`, and `baseline` cover other comparisons. |
18
+
19
+ `preview` opens Map DevTools. `init`, `validate`, and `build` remain project utilities;
20
+ `visual update` is the explicit operation that approves baselines. All these tools work from an
21
+ independent project with its own map and data; official maps are optional.
22
+
23
+ Start with bounded queries, then request more detail at the returned JSON Pointers:
24
+
25
+ ```sh
26
+ npx tileflow describe --json
27
+ npx tileflow describe roads --path /properties/classes --json
28
+ npx tileflow describe themes --json
29
+ npx tileflow inspect --domain roads --limit 80 --json
30
+ npx tileflow inspect compiled --domain roads --theme dark --json
31
+ npx tileflow compare configs --from-config before/tileflow.config.ts --to-config after/tileflow.config.ts --json
32
+ ```
33
+
34
+ `describe` needs no project or network. It reads the generated schema and manifest, with `--ref`
35
+ for an exact local schema reference, `--path` for an RFC 6901 JSON Pointer, and `--limit`/`--depth`
36
+ for bounded tree projections. `projection.truncated` and `projection.omitted` explicitly identify
37
+ missing detail; omitted pointers are relative to the selected data. These fragments are discovery
38
+ results, not standalone validation schemas. Examples and expression syntax remain in the generated
39
+ contracts and package guides. Config inspection supports the same bounds; without projection
40
+ options it preserves the complete legacy result.
41
+
42
+ Legacy aliases remain available: `explain` → `inspect compiled`, `semantic-diff` → `compare configs`,
43
+ `icons list` → `inspect icons`, `tileset inspect` → `inspect tileset`, and `visual compare/analyze/diff`
44
+ → `compare styles/reference/baseline`. Aliases share implementations and retain their established
45
+ versioned JSON document formats. `language manifest` returns
46
+ the raw authoring manifest (schema version 2); `language schema` returns the raw generated config
47
+ reference (version 4). Use their versions and schema references when consuming the output.
48
+
49
+ `validate`, `inspect`, `explain`, and `semantic-diff` return one version-1 command envelope on
50
+ stdout. JSON-mode failures leave stdout empty, write one structured failure to stderr, and exit
51
+ nonzero. Diagnostics include `phase`, `code`, `path`, `severity`, `message`, and `suggestion`.
52
+ A non-empty semantic diff is informational, not a command failure.
53
+
54
+ Inspection includes resolved inheritance, merge provenance, and the theme contract. `explain`
55
+ returns compilation diagnostics and a report, not the complete Style JSON. Add `--inspection` only
56
+ when physical output provenance is needed; those layer IDs are not stable authoring targets.
57
+
58
+ `describe themes` lists the minimal palette roles and optional time-of-day behavior. Compiled
59
+ inspection includes `report.decisions` for resolved color roles and selected module defaults,
60
+ with the effective value, source, reason and override guidance. Query it with
61
+ `inspect compiled --path /report/decisions --limit 80 --json`. It describes semantic decisions,
62
+ not every final paint property; config inspection retains inheritance provenance separately.
63
+
64
+ For a normal config, map selection is implicit. Paired `--from-config` and `--to-config` compare
65
+ two ordinary configs. Workspace comparisons use their documented explicit map selectors; do not
66
+ mix the paired-config and same-workspace forms.
67
+
68
+ ## Reuse capture evidence
69
+
70
+ Every still capture saves an immutable record under `.tileflow/captures/records` and returns its
71
+ full `captureId` in JSON (or prints it in human output). Keep the ID before editing, capture again,
72
+ then compare the two IDs:
73
+
74
+ ```sh
75
+ npx tileflow capture madrid --json
76
+ # Edit the map, then capture the same scene again.
77
+ npx tileflow capture madrid --json
78
+ npx tileflow compare --before <before-capture-id> --after <after-capture-id> --json
79
+ ```
80
+
81
+ Replace the placeholders with the full IDs from the two capture results. This comparison loads
82
+ only saved evidence: no config evaluation, compilation, browser startup, or network access.
83
+ `--capture-dir` selects another record directory; `--diff <path>` writes a contextual PNG diff.
84
+ Records verify their JSON, PNG, receipt, and scene hashes. Different cameras, viewport dimensions,
85
+ renderers, or data identities produce a mismatch and nonzero exit instead of misleading pixel
86
+ metrics. A visual difference between comparable captures is informational. Records remain until
87
+ you remove their directory; moving only the mutable scene PNG does not move its saved record.
88
+
89
+ For repeated capture use `capture --watch`; it reuses the artifact session and browser. Config
90
+ inspection does not render; `compare configs` compares semantic authoring without rendering.
91
+ `compare styles --watch` reuses sessions for a camera/zoom matrix. Run standalone validation when
92
+ needed, rather than compiling the same map before every capture.
93
+
94
+ ## Work with a person and an agent
95
+
96
+ Start `npx tileflow preview --config tileflow.config.ts` in your project. Map DevTools provides
97
+ palette and time-of-day controls, feature inspection, zoom curves and sprite inspection.
98
+ The command selects the map and optional starting scene. The map fills the workspace beside
99
+ one dockable developer-tools panel. Press **I** to toggle the element picker, click a map element to
100
+ inspect its styling and semantic configuration paths, and press **Escape** to stop picking. The
101
+ inspector starts off. **Scene** contains palette, time-of-day, camera and module controls. Appearance
102
+ changes retain the current camera; module changes
103
+ recompile a temporary preview after a brief pause and **Reset** restores the source configuration.
104
+ Temporary style and geometry edits do not rewrite source files. Edit the config in your editor or
105
+ coding agent to persist changes; the watcher updates the map and retains the last valid view through
106
+ invalid edits.
107
+
108
+ Capture, copy/export and comparison controls are absent from the browser interface. Use
109
+ `tileflow capture` and `tileflow compare` for saved visual evidence as described above. Explicit
110
+ `--against-map` or `--against-config` startup options still support synchronized two-map previews.
111
+
112
+ The browser publishes its current selection, bounded style properties, compiler semantic ownership,
113
+ observed camera and viewport, generations and commands. The CLI reads these browser observations:
114
+
115
+ ```sh
116
+ npx tileflow inspect session --url http://127.0.0.1:3333 --json
117
+ ```
118
+
119
+ Replace the origin with the one printed by `preview`. This command accepts local HTTP origins only
120
+ and requires no config evaluation. Its version-1 document distinguishes the current server catalog
121
+ from browser observations. Inspect `updatedAt`, `stale`, `generation`, `displayedGeneration` and
122
+ `projection.truncated` before acting. Each browser projection is limited to 200 visited values,
123
+ depth 10, 32 array items and 512 characters per string, with omitted paths reported. The server
124
+ accepts at most 64 KiB per write and keeps eight browser contexts, expiring each after ten minutes
125
+ without an update. There is no browser context until a Map DevTools tab connects. Feature data is
126
+ untrusted map content; semantic ownership does not prove an exact file, line or token. Use
127
+ `inspect` or `inspect compiled` to obtain additional configuration evidence.
128
+
129
+ The UI and CLI share the capture and comparison implementations. A lazily started capture renderer
130
+ is reused until the preview stops. The local API permits one capture/comparison at a time, rejects
131
+ cross-origin writes and requires JSON with `X-Tileflow-Workbench: 1`. No hosted account, embedded
132
+ chat, approved baseline or automatic source edit is created by this workflow.
@@ -39,7 +39,7 @@ npx tileflow preview --renderer native --map stores --theme light
39
39
  Native mode creates the existing watched artifact session with renderer `native`. It keeps the
40
40
  last-known-good native artifact family when a watched generation becomes invalid and replaces it
41
41
  only after a later valid generation is prepared. The endpoint is an **assets-only** development
42
- endpoint: it does not render a browser map, open the visual workbench, start Metro, launch a device,
42
+ endpoint: it does not render a browser map, open Map DevTools, start Metro, launch a device,
43
43
  or establish visual/native acceptance.
44
44
 
45
45
  With the default host and port, the canonical runtime manifest is:
@@ -77,7 +77,7 @@ developer remain responsible for making an explicitly selected development endpo
77
77
  under their own platform/network policy.
78
78
 
79
79
  Browser-only selections fail before config execution in native mode. In particular, committed
80
- `--scene` preview and every `--against-*` comparison-workbench option are unavailable with
80
+ `--scene` preview and every `--against-*` live-comparison option are unavailable with
81
81
  `--renderer native`. Native mode does not serve the browser preview root, preview JavaScript runtime,
82
82
  compiler-inspection sidecars, or the dev handler's status/event control routes. Use ordinary/default
83
83
  web preview for those workflows.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tileflow",
3
- "version": "0.1.0-alpha.12",
3
+ "version": "0.1.0-alpha.14",
4
4
  "license": "Apache-2.0",
5
5
  "description": "CLI-only tools for Tileflow config, capture, visual testing, and deploy.",
6
6
  "type": "module",
@@ -36,12 +36,12 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@hono/node-server": "2.1.3",
39
- "@tileflow/capture": ">=0.1.0-alpha.30 <0.1.0-beta.0",
39
+ "@tileflow/capture": ">=0.1.0-alpha.31 <0.1.0-beta.0",
40
40
  "@tileflow/coordinates": ">=0.1.0-alpha.2 <0.1.0-beta.0",
41
41
  "@tileflow/coordinates-runtime": ">=0.1.0-alpha.5 <0.1.0-beta.0",
42
- "@tileflow/core": ">=0.1.0-alpha.34 <0.1.0-beta.0",
43
- "@tileflow/dev": ">=0.1.0-alpha.31 <0.1.0-beta.0",
44
- "@tileflow/maps": ">=0.1.0-alpha.8 <0.1.0-beta.0",
42
+ "@tileflow/core": ">=0.1.0-alpha.36 <0.1.0-beta.0",
43
+ "@tileflow/dev": ">=0.1.0-alpha.33 <0.1.0-beta.0",
44
+ "@tileflow/maps": ">=0.1.0-alpha.10 <0.1.0-beta.0",
45
45
  "commander": "^15.0.0",
46
46
  "hono": "4.13.7",
47
47
  "picocolors": "^1.1.1",