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.
package/README.md CHANGED
@@ -22,9 +22,9 @@ Run these commands from the project directory. After installation, `npx tileflow
22
22
  executable. With another package manager, use its local-execution command and the existing lockfile;
23
23
  do not add a second lockfile or rely on a globally installed CLI.
24
24
 
25
- `init` creates a singular `tileflow.config.ts` extending the official Streets map. `preview` serves
26
- the exported map using its configured view; it does not replace an application's normal development
27
- server.
25
+ `init` creates a singular `tileflow.config.ts` extending the official Streets map. `preview` opens
26
+ Map DevTools with that map, live reload, rendered-feature inspection, compiler attribution, zoom
27
+ curves, a sprite atlas, scene selection, saved captures, and before/after review.
28
28
 
29
29
  Local validation, compilation, and asset preparation require no account or API key. Preview and
30
30
  capture may fetch configured remote tiles and fonts. Config files are executable trusted code,
@@ -51,35 +51,16 @@ explicitly or supply an application-owned production source.
51
51
  To work on another map, use `--config <path>`. An ordinary config exports one map. Multi-map
52
52
  workspaces are advanced repository orchestration, not a second application authoring model.
53
53
 
54
- ## Discover the language and inspect a change
54
+ ## Map development tools
55
55
 
56
- Agents should read generated contracts instead of guessing property names, expression syntax, or
57
- compiler-generated layer IDs:
56
+ Use `describe` for bounded language discovery (`describe themes --json` lists palette requirements
57
+ and optional time-of-day composition), `inspect` for configuration and data, `capture`
58
+ for reproducible evidence, and `compare` for saved captures, semantic edits, styles, references or
59
+ baselines. `preview` opens Map DevTools. These tools work in independent projects with
60
+ custom maps and data; official maps are optional.
58
61
 
59
- ```sh
60
- npx tileflow language manifest --json
61
- npx tileflow language schema --json
62
- npx tileflow inspect --json
63
- npx tileflow explain --theme dark --json
64
- npx tileflow semantic-diff --from-config before/tileflow.config.ts --to-config after/tileflow.config.ts --json
65
- ```
66
-
67
- The language commands need no project and perform no network access. `language manifest` returns
68
- the raw authoring manifest (schema version 2); `language schema` returns the raw generated config
69
- reference (version 4). Use their versions and schema references when consuming the output.
70
-
71
- `validate`, `inspect`, `explain`, and `semantic-diff` return one version-1 command envelope on
72
- stdout. JSON-mode failures leave stdout empty, write one structured failure to stderr, and exit
73
- nonzero. Diagnostics include `phase`, `code`, `path`, `severity`, `message`, and `suggestion`.
74
- A non-empty semantic diff is informational, not a command failure.
75
-
76
- Inspection includes resolved inheritance, merge provenance, and the theme contract. `explain`
77
- returns compilation diagnostics and a report, not the complete Style JSON. Add `--inspection` only
78
- when physical output provenance is needed; those layer IDs are not stable authoring targets.
79
-
80
- For a normal config, map selection is implicit. Paired `--from-config` and `--to-config` compare
81
- two ordinary configs. Workspace comparisons use their documented explicit map selectors; do not
82
- mix the paired-config and same-workspace forms.
62
+ See the [map authoring workflow](https://github.com/tileflow/tileflow-sdk/blob/main/packages/cli/docs/map-authoring.md)
63
+ for command examples, bounded JSON queries, compatible aliases and efficient agent workflows.
83
64
 
84
65
  ## Preview and compare
85
66
 
@@ -87,21 +68,63 @@ mix the paired-config and same-workspace forms.
87
68
  it does not implicitly expose a public listener. `--theme <name>` selects a concrete theme.
88
69
  `--scene <name>` selects a committed standalone scene.
89
70
 
90
- Compare two configs in the live workbench:
71
+ Run `npx tileflow preview` from your project directory to load `tileflow.config.ts`, start the
72
+ watched server, and automatically open Map DevTools in your default browser once the server is
73
+ listening. Use `--config <path>` for another config or `--no-open` to start without opening a tab.
74
+ `--json` and `--renderer native` also keep the browser closed. The CLI always prints the local URL
75
+ in ordinary web preview output, so you can open it manually if browser launch is unavailable.
76
+
77
+ Opening Map DevTools through another loopback name, such as `localhost` instead of `127.0.0.1`,
78
+ redirects to the **Local** origin printed by the CLI, preserving camera and theme query parameters.
79
+ This keeps the map, palette controls, and workbench API on the same origin.
80
+
81
+ Run from the project directory and keep selected configs inside it, so capture commands copied from
82
+ Map DevTools resolve the same files. The project itself can live anywhere, independently of this SDK.
83
+
84
+ The default is one Map DevTools pane, one watched artifact session, and one map renderer. Choose a
85
+ map, theme or configured scene in **Controls**. Map and theme pickers appear when there are multiple choices. **Compare → Compare live maps** adds a reference from the current
86
+ project; `--against-*` also supports a reference from another config. The native renderer retains its assets-only
87
+ preview endpoint.
88
+
89
+ Compare two configs live in Map DevTools:
91
90
 
92
91
  ```sh
93
92
  npx tileflow preview --config candidate/tileflow.config.ts --against-config reference/tileflow.config.ts
94
93
  ```
95
94
 
96
- The workbench shares a camera across side-by-side, split, overlay, or blink views. Its inspector
95
+ Map DevTools shares a camera across side-by-side, split, overlay, or blink views. Its inspector
97
96
  shows bounded feature and compiler information; invalid edits keep the last valid generation.
98
- Use headless capture, not the live viewport, when exact dimensions and device-pixel ratio matter.
97
+ **Capture as reference** saves a starting point. After editing, **Capture & compare** reuses its
98
+ camera and frame to review the change. The selected reference lasts for this browser session.
99
+
100
+ **Capture** renders the compiled map at the current camera and the fixed dimensions in **Capture settings** (the sliders icon).
101
+ Temporary preview visibility switches are excluded. **Captures** retains local evidence across
102
+ reloads; **Compare** checks saved captures before offering a before/after slider and pixel difference.
103
+ Each capture has a **Delete** action with confirmation that removes its saved image and record from this project.
104
+ It reports incompatible cameras, frames, renderers or data without presenting pixel metrics.
105
+
106
+ **Copy context for AI** exports the selected feature, semantic configuration paths, camera, revision
107
+ and reproducible commands. An agent can also read the active browser context:
108
+
109
+ ```sh
110
+ npx tileflow inspect session --url http://127.0.0.1:3333 --json
111
+ ```
112
+
113
+ Use the origin printed by your running preview. This reads browser observations, including their
114
+ age and stale flag; exact source lines and token ownership are not inferred. See the
115
+ [Map DevTools workflow](https://github.com/tileflow/tileflow-sdk/blob/main/packages/cli/docs/map-authoring.md#work-with-a-person-and-an-agent)
116
+ for storage and context bounds.
99
117
 
100
118
  `--api-base-url` or `TILEFLOW_API_URL` changes the API origin used by the official preview sources.
101
119
  It does not change the map's authored data ownership or publish any data.
102
120
 
103
121
  ## Capture a reproducible scene
104
122
 
123
+ Captures return reusable IDs. Compare two saved renders with
124
+ `tileflow compare --before <id> --after <id> --json`; no config, browser, or network is needed.
125
+ The [authoring workflow](https://github.com/tileflow/tileflow-sdk/blob/main/packages/cli/docs/map-authoring.md)
126
+ describes storage, integrity checks, mismatch outcomes and watch-session reuse.
127
+
105
128
  Add a concrete-theme scene to `tileflow.config.ts`:
106
129
 
107
130
  <!-- docs:check -->
@@ -312,6 +335,9 @@ revision; prefer the installed copy when working with an older release.
312
335
  ## Validate icon representations
313
336
 
314
337
  `tileflow validate`, development and build resolve icon capabilities before returning a map.
338
+ Validation and deployment also prepare map-owned tree models before compiling styles or making
339
+ remote writes. Invalid or missing model files report a local asset error; prepared geometry travels
340
+ inside the style, including models inherited from Streets.
315
341
  `TF_ICON_REPRESENTATION_MIXED` means a layer can select SDF and RGBA icons, including a fallback or
316
342
  local override. Keep that selection homogeneous or use an explicit bounded mapping. Development
317
343
  reports the invalid generation while retaining its last valid artifact.