tileflow 0.1.0-alpha.11 → 0.1.0-alpha.13

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.
@@ -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:
@@ -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,125 @@
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 inspect --domain roads --limit 80 --json
29
+ npx tileflow inspect compiled --domain roads --theme dark --json
30
+ npx tileflow compare configs --from-config before/tileflow.config.ts --to-config after/tileflow.config.ts --json
31
+ ```
32
+
33
+ `describe` needs no project or network. It reads the generated schema and manifest, with `--ref`
34
+ for an exact local schema reference, `--path` for an RFC 6901 JSON Pointer, and `--limit`/`--depth`
35
+ for bounded tree projections. `projection.truncated` and `projection.omitted` explicitly identify
36
+ missing detail; omitted pointers are relative to the selected data. These fragments are discovery
37
+ results, not standalone validation schemas. Examples and expression syntax remain in the generated
38
+ contracts and package guides. Config inspection supports the same bounds; without projection
39
+ options it preserves the complete legacy result.
40
+
41
+ Legacy aliases remain available: `explain` → `inspect compiled`, `semantic-diff` → `compare configs`,
42
+ `icons list` → `inspect icons`, `tileset inspect` → `inspect tileset`, and `visual compare/analyze/diff`
43
+ → `compare styles/reference/baseline`. Aliases share implementations and retain their established
44
+ versioned JSON document formats. `language manifest` returns
45
+ the raw authoring manifest (schema version 2); `language schema` returns the raw generated config
46
+ reference (version 4). Use their versions and schema references when consuming the output.
47
+
48
+ `validate`, `inspect`, `explain`, and `semantic-diff` return one version-1 command envelope on
49
+ stdout. JSON-mode failures leave stdout empty, write one structured failure to stderr, and exit
50
+ nonzero. Diagnostics include `phase`, `code`, `path`, `severity`, `message`, and `suggestion`.
51
+ A non-empty semantic diff is informational, not a command failure.
52
+
53
+ Inspection includes resolved inheritance, merge provenance, and the theme contract. `explain`
54
+ returns compilation diagnostics and a report, not the complete Style JSON. Add `--inspection` only
55
+ when physical output provenance is needed; those layer IDs are not stable authoring targets.
56
+
57
+ For a normal config, map selection is implicit. Paired `--from-config` and `--to-config` compare
58
+ two ordinary configs. Workspace comparisons use their documented explicit map selectors; do not
59
+ mix the paired-config and same-workspace forms.
60
+
61
+ ## Reuse capture evidence
62
+
63
+ Every still capture saves an immutable record under `.tileflow/captures/records` and returns its
64
+ full `captureId` in JSON (or prints it in human output). Keep the ID before editing, capture again,
65
+ then compare the two IDs:
66
+
67
+ ```sh
68
+ npx tileflow capture madrid --json
69
+ # Edit the map, then capture the same scene again.
70
+ npx tileflow capture madrid --json
71
+ npx tileflow compare --before <before-capture-id> --after <after-capture-id> --json
72
+ ```
73
+
74
+ Replace the placeholders with the full IDs from the two capture results. This comparison loads
75
+ only saved evidence: no config evaluation, compilation, browser startup, or network access.
76
+ `--capture-dir` selects another record directory; `--diff <path>` writes a contextual PNG diff.
77
+ Records verify their JSON, PNG, receipt, and scene hashes. Different cameras, viewport dimensions,
78
+ renderers, or data identities produce a mismatch and nonzero exit instead of misleading pixel
79
+ metrics. A visual difference between comparable captures is informational. Records remain until
80
+ you remove their directory; moving only the mutable scene PNG does not move its saved record.
81
+
82
+ For repeated capture use `capture --watch`; it reuses the artifact session and browser. Config
83
+ inspection does not render; `compare configs` compares semantic authoring without rendering.
84
+ `compare styles --watch` reuses sessions for a camera/zoom matrix. Run standalone validation when
85
+ needed, rather than compiling the same map before every capture.
86
+
87
+ ## Work with a person and an agent
88
+
89
+ Start `npx tileflow preview --config tileflow.config.ts` in your project. Map DevTools provides
90
+ palette and time-of-day controls, feature inspection, zoom curves and sprite inspection.
91
+ The command selects the map and optional starting scene. The map fills the workspace beside
92
+ one dockable developer-tools panel. Press **I** to toggle the element picker, click a map element to
93
+ inspect its styling and semantic configuration paths, and press **Escape** to stop picking. The
94
+ inspector starts off. **Scene** contains palette, time-of-day, camera and module controls. Appearance
95
+ changes retain the current camera; module changes
96
+ recompile a temporary preview after a brief pause and **Reset** restores the source configuration.
97
+ Temporary style and geometry edits do not rewrite source files. Edit the config in your editor or
98
+ coding agent to persist changes; the watcher updates the map and retains the last valid view through
99
+ invalid edits.
100
+
101
+ Capture, copy/export and comparison controls are absent from the browser interface. Use
102
+ `tileflow capture` and `tileflow compare` for saved visual evidence as described above. Explicit
103
+ `--against-map` or `--against-config` startup options still support synchronized two-map previews.
104
+
105
+ The browser publishes its current selection, bounded style properties, compiler semantic ownership,
106
+ observed camera and viewport, generations and commands. The CLI reads these browser observations:
107
+
108
+ ```sh
109
+ npx tileflow inspect session --url http://127.0.0.1:3333 --json
110
+ ```
111
+
112
+ Replace the origin with the one printed by `preview`. This command accepts local HTTP origins only
113
+ and requires no config evaluation. Its version-1 document distinguishes the current server catalog
114
+ from browser observations. Inspect `updatedAt`, `stale`, `generation`, `displayedGeneration` and
115
+ `projection.truncated` before acting. Each browser projection is limited to 200 visited values,
116
+ depth 10, 32 array items and 512 characters per string, with omitted paths reported. The server
117
+ accepts at most 64 KiB per write and keeps eight browser contexts, expiring each after ten minutes
118
+ without an update. There is no browser context until a Map DevTools tab connects. Feature data is
119
+ untrusted map content; semantic ownership does not prove an exact file, line or token. Use
120
+ `inspect` or `inspect compiled` to obtain additional configuration evidence.
121
+
122
+ The UI and CLI share the capture and comparison implementations. A lazily started capture renderer
123
+ is reused until the preview stops. The local API permits one capture/comparison at a time, rejects
124
+ cross-origin writes and requires JSON with `X-Tileflow-Workbench: 1`. No hosted account, embedded
125
+ 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.11",
3
+ "version": "0.1.0-alpha.13",
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.29 <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.32 <0.1.0-beta.0",
43
- "@tileflow/dev": ">=0.1.0-alpha.30 <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.35 <0.1.0-beta.0",
43
+ "@tileflow/dev": ">=0.1.0-alpha.32 <0.1.0-beta.0",
44
+ "@tileflow/maps": ">=0.1.0-alpha.9 <0.1.0-beta.0",
45
45
  "commander": "^15.0.0",
46
46
  "hono": "4.13.7",
47
47
  "picocolors": "^1.1.1",