tileflow 0.1.0-alpha.12 → 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.
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,15 @@ 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, `inspect` for configuration and data, `capture`
57
+ for reproducible evidence, and `compare` for saved captures, semantic edits, styles, references or
58
+ baselines. `preview` opens Map DevTools. These tools work in independent projects with
59
+ custom maps and data; official maps are optional.
58
60
 
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.
61
+ See the [map authoring workflow](https://github.com/tileflow/tileflow-sdk/blob/main/packages/cli/docs/map-authoring.md)
62
+ for command examples, bounded JSON queries, compatible aliases and efficient agent workflows.
83
63
 
84
64
  ## Preview and compare
85
65
 
@@ -87,21 +67,63 @@ mix the paired-config and same-workspace forms.
87
67
  it does not implicitly expose a public listener. `--theme <name>` selects a concrete theme.
88
68
  `--scene <name>` selects a committed standalone scene.
89
69
 
90
- Compare two configs in the live workbench:
70
+ Run `npx tileflow preview` from your project directory to load `tileflow.config.ts`, start the
71
+ watched server, and automatically open Map DevTools in your default browser once the server is
72
+ listening. Use `--config <path>` for another config or `--no-open` to start without opening a tab.
73
+ `--json` and `--renderer native` also keep the browser closed. The CLI always prints the local URL
74
+ in ordinary web preview output, so you can open it manually if browser launch is unavailable.
75
+
76
+ Opening Map DevTools through another loopback name, such as `localhost` instead of `127.0.0.1`,
77
+ redirects to the **Local** origin printed by the CLI, preserving camera and theme query parameters.
78
+ This keeps the map, palette controls, and workbench API on the same origin.
79
+
80
+ Run from the project directory and keep selected configs inside it, so capture commands copied from
81
+ Map DevTools resolve the same files. The project itself can live anywhere, independently of this SDK.
82
+
83
+ The default is one Map DevTools pane, one watched artifact session, and one map renderer. Choose a
84
+ 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
85
+ project; `--against-*` also supports a reference from another config. The native renderer retains its assets-only
86
+ preview endpoint.
87
+
88
+ Compare two configs live in Map DevTools:
91
89
 
92
90
  ```sh
93
91
  npx tileflow preview --config candidate/tileflow.config.ts --against-config reference/tileflow.config.ts
94
92
  ```
95
93
 
96
- The workbench shares a camera across side-by-side, split, overlay, or blink views. Its inspector
94
+ Map DevTools shares a camera across side-by-side, split, overlay, or blink views. Its inspector
97
95
  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.
96
+ **Capture as reference** saves a starting point. After editing, **Capture & compare** reuses its
97
+ camera and frame to review the change. The selected reference lasts for this browser session.
98
+
99
+ **Capture** renders the compiled map at the current camera and the fixed dimensions in **Capture settings** (the sliders icon).
100
+ Temporary preview visibility switches are excluded. **Captures** retains local evidence across
101
+ reloads; **Compare** checks saved captures before offering a before/after slider and pixel difference.
102
+ Each capture has a **Delete** action with confirmation that removes its saved image and record from this project.
103
+ It reports incompatible cameras, frames, renderers or data without presenting pixel metrics.
104
+
105
+ **Copy context for AI** exports the selected feature, semantic configuration paths, camera, revision
106
+ and reproducible commands. An agent can also read the active browser context:
107
+
108
+ ```sh
109
+ npx tileflow inspect session --url http://127.0.0.1:3333 --json
110
+ ```
111
+
112
+ Use the origin printed by your running preview. This reads browser observations, including their
113
+ age and stale flag; exact source lines and token ownership are not inferred. See the
114
+ [Map DevTools workflow](https://github.com/tileflow/tileflow-sdk/blob/main/packages/cli/docs/map-authoring.md#work-with-a-person-and-an-agent)
115
+ for storage and context bounds.
99
116
 
100
117
  `--api-base-url` or `TILEFLOW_API_URL` changes the API origin used by the official preview sources.
101
118
  It does not change the map's authored data ownership or publish any data.
102
119
 
103
120
  ## Capture a reproducible scene
104
121
 
122
+ Captures return reusable IDs. Compare two saved renders with
123
+ `tileflow compare --before <id> --after <id> --json`; no config, browser, or network is needed.
124
+ The [authoring workflow](https://github.com/tileflow/tileflow-sdk/blob/main/packages/cli/docs/map-authoring.md)
125
+ describes storage, integrity checks, mismatch outcomes and watch-session reuse.
126
+
105
127
  Add a concrete-theme scene to `tileflow.config.ts`:
106
128
 
107
129
  <!-- docs:check -->
@@ -312,6 +334,9 @@ revision; prefer the installed copy when working with an older release.
312
334
  ## Validate icon representations
313
335
 
314
336
  `tileflow validate`, development and build resolve icon capabilities before returning a map.
337
+ Validation and deployment also prepare map-owned tree models before compiling styles or making
338
+ remote writes. Invalid or missing model files report a local asset error; prepared geometry travels
339
+ inside the style, including models inherited from Streets.
315
340
  `TF_ICON_REPRESENTATION_MIXED` means a layer can select SDF and RGBA icons, including a fallback or
316
341
  local override. Keep that selection homogeneous or use an explicit bounded mapping. Development
317
342
  reports the invalid generation while retaining its last valid artifact.