tileflow 0.0.0-bootstrap.0 → 0.1.0-alpha.0
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 +153 -62
- package/dist/index.js +2126 -358
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ no Tileflow account or API key:
|
|
|
9
9
|
|
|
10
10
|
```sh
|
|
11
11
|
npm install @tileflow/core@alpha @tileflow/maps@alpha
|
|
12
|
-
npm install --save-dev --save-exact tileflow@
|
|
12
|
+
npm install --save-dev --save-exact tileflow@alpha
|
|
13
13
|
npx tileflow init
|
|
14
14
|
npx tileflow validate
|
|
15
15
|
npx tileflow validate --target hosted
|
|
@@ -68,9 +68,16 @@ explicitly with `--out`:
|
|
|
68
68
|
npx tileflow build --out public/tileflow
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
+
Named hosted sources with `local` archives are for preview and capture. `tileflow build` rejects
|
|
72
|
+
them instead of copying user data into production output. Publish managed data explicitly with
|
|
73
|
+
`tileset publish`, or provide the production dataset through an application-owned source.
|
|
74
|
+
Preview, capture, and the React/Vue/Svelte adapters register Tileflow's local PMTiles protocol
|
|
75
|
+
before MapLibre reads the compiled Style. Its URL is stable by logical tileset ID; physical local
|
|
76
|
+
snapshot generations do not change Style or Capture identity.
|
|
77
|
+
|
|
71
78
|
Build is local and credential-free. Hosted compatibility is a separate
|
|
72
|
-
`tileflow validate --target hosted` preflight
|
|
73
|
-
|
|
79
|
+
`tileflow validate --target hosted` preflight. Primary map data must remain Tileflow World; named
|
|
80
|
+
Team sources are validated and resolved independently.
|
|
74
81
|
|
|
75
82
|
## Deterministic agent diagnostics
|
|
76
83
|
|
|
@@ -80,14 +87,23 @@ Use JSON mode when an agent or CI job needs to validate or reason about the reso
|
|
|
80
87
|
npx tileflow validate --json
|
|
81
88
|
npx tileflow inspect --json
|
|
82
89
|
npx tileflow inspect --map madrid --json
|
|
90
|
+
npx tileflow language manifest --json
|
|
91
|
+
npx tileflow language schema --json
|
|
92
|
+
npx tileflow explain --map madrid --theme dark --json
|
|
93
|
+
npx tileflow semantic-diff --from-config before/tileflow.config.ts --to-config after/tileflow.config.ts --json
|
|
94
|
+
npx tileflow semantic-diff --config maps.workspace.ts --from before --to after --json
|
|
83
95
|
```
|
|
84
96
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
97
|
+
`validate`, `inspect`, `explain`, and `semantic-diff` success writes exactly one
|
|
98
|
+
schema-version-1 command envelope to stdout. The two discovery commands intentionally return their
|
|
99
|
+
contracts raw instead of wrapping them: `language manifest --json` emits authoring-manifest version
|
|
100
|
+
2 and `language schema --json` emits config-reference version 4. Every JSON-mode failure, including
|
|
101
|
+
failure to load either raw discovery contract, leaves stdout empty and writes one schema-version-1
|
|
102
|
+
command failure to stderr. Command summaries and every failure diagnostic contain `phase`, `code`,
|
|
103
|
+
`path`, `severity`, `message`, and a bounded safe `suggestion`; diagnostics are sorted and
|
|
104
|
+
deduplicated deterministically.
|
|
89
105
|
|
|
90
|
-
Config inspection returns the resolved map,
|
|
106
|
+
Config inspection returns the resolved map, parent-to-leaf lineage, declared paths, leaf-level merge
|
|
91
107
|
provenance, and an explicit `themeContract`: default/system selection, shared token schema,
|
|
92
108
|
concrete values, typography, lighting, differences from the default, and stable audit diagnostics.
|
|
93
109
|
It omits the executable input-file graph and sanitizes credentials, URL queries,
|
|
@@ -98,15 +114,59 @@ config with `extends` and `scenes`, while its named `resolved` entrypoint matche
|
|
|
98
114
|
compiler input. Both are produced from executable core schemas rather than a handwritten parallel
|
|
99
115
|
API list.
|
|
100
116
|
|
|
117
|
+
`tileflow language manifest --json` discovers the complete closed semantic language without loading
|
|
118
|
+
a project: compiler identity, domains and their dependencies, public operations, expression-builder
|
|
119
|
+
signatures and limits, render selectors, semantic fields/features, diagnostics, reports, commands,
|
|
120
|
+
and schema references. `tileflow language schema --json` returns the packaged generated JSON Schema
|
|
121
|
+
that those references address. Together they are the canonical bootstrap surface for an authoring
|
|
122
|
+
agent; neither command writes files or accesses the network.
|
|
123
|
+
|
|
124
|
+
Each manifest command entry declares its `outputKind`, `outputVersion`, and stable
|
|
125
|
+
`outputSchemaRef`. `raw-authoring-manifest` and `raw-config-reference` identify the two bootstrap
|
|
126
|
+
documents above; `command-envelope` identifies the ordinary version-1 CLI contract.
|
|
127
|
+
|
|
128
|
+
`tileflow explain` compiles exactly one map/theme selection through `createStyleResult()` and emits
|
|
129
|
+
its structured `report` and safe compiler `diagnostics`; it deliberately omits the usually large
|
|
130
|
+
MapLibre `style`. In a singular config, `--map` is optional; a multi-map workbench requires it.
|
|
131
|
+
`--theme` defaults to that map's declared default. `--inspection` adds opt-in, read-only
|
|
132
|
+
physical-output provenance to the report. Its physical layer IDs and indexes are diagnostic
|
|
133
|
+
observations only: they are not stable application or authoring targets, and no semantic operation
|
|
134
|
+
accepts them. The JSON document has this stable projection:
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"schemaVersion": 1,
|
|
139
|
+
"command": "explain",
|
|
140
|
+
"ok": true,
|
|
141
|
+
"selection": {"map": "madrid", "theme": "dark"},
|
|
142
|
+
"authoringManifestSchemaVersion": 2,
|
|
143
|
+
"compilation": {"ok": true, "diagnostics": [], "report": {}},
|
|
144
|
+
"diagnostics": []
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
`tileflow semantic-diff --from-config <path> --to-config <path>` compares the sole map exported by
|
|
149
|
+
each ordinary config, which is the normal agent workflow for reviewing a change across two files or
|
|
150
|
+
checkouts. If either endpoint is a multi-map `*.workspace.ts`, select that endpoint explicitly with
|
|
151
|
+
`--from-map` or `--to-map`; selectors are rejected for singular configs. The existing
|
|
152
|
+
`--config <workspace> --from <map> --to <map>` form remains as the same-workspace shortcut. Paired
|
|
153
|
+
config options and workspace options cannot be mixed.
|
|
154
|
+
|
|
155
|
+
The successful document adds `diff`, whose exact core shape is `{schemaVersion, from, to, summary,
|
|
156
|
+
changes}`; each change is `add`, `remove`, or `change` at an RFC 6901 JSON Pointer. Differences are
|
|
157
|
+
informational, so a non-empty diff still exits successfully. Selection, load, validation, asset, or
|
|
158
|
+
compilation failures leave stdout empty and emit one safe structured document on stderr.
|
|
159
|
+
|
|
101
160
|
## Command families
|
|
102
161
|
|
|
103
|
-
| Family
|
|
104
|
-
|
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
|
|
|
109
|
-
|
|
|
162
|
+
| Family | Commands |
|
|
163
|
+
| ----------------- | ---------------------------------------------------------------------------------------------- |
|
|
164
|
+
| Semantic language | `language manifest`, `language schema` |
|
|
165
|
+
| Map authoring | `init`, `validate`, `inspect`, `explain`, `semantic-diff`, `build`, `preview` (`dev` alias) |
|
|
166
|
+
| Local evidence | `setup capture`, `capture`, `visual compare`, `visual analyze`, `visual diff`, `visual update` |
|
|
167
|
+
| Data and assets | `tileset inspect`, `tileset publish/list/status/purge`, `inspect features`, `icons list/diff` |
|
|
168
|
+
| Account | `login`, `logout`, `whoami` |
|
|
169
|
+
| Hosted delivery | `deploy`, `status` |
|
|
110
170
|
|
|
111
171
|
Run `tileflow <command> --help` (or the family help, such as `tileflow icons --help`) for the exact
|
|
112
172
|
arguments and bounded JSON modes.
|
|
@@ -404,50 +464,87 @@ effects and removes `TILEFLOW_API_KEY` before loading config.
|
|
|
404
464
|
Hosted writes have two independent authorization paths:
|
|
405
465
|
|
|
406
466
|
- Personal developer session: run `npx tileflow login` once for a
|
|
407
|
-
Tileflow API origin. Login authenticates the account and selects no
|
|
408
|
-
|
|
409
|
-
|
|
467
|
+
Tileflow API origin. Login authenticates the account and selects no Map.
|
|
468
|
+
Map commands exchange it for a brief Map capability; tileset commands use a separate Team data
|
|
469
|
+
capability.
|
|
410
470
|
- CI key: create a dashboard `CI deploy` key, store it as
|
|
411
|
-
`TILEFLOW_API_KEY`, and let the repository workflow deploy without a local
|
|
412
|
-
|
|
471
|
+
`TILEFLOW_API_KEY`, and let the repository workflow deploy without a local login. The server
|
|
472
|
+
binds that key to exactly one Map.
|
|
413
473
|
|
|
414
474
|
Hosted control-plane requests stay pinned to the configured HTTP(S) origin, apply a hard bounded
|
|
415
475
|
timeout, and stream at most 1 MiB of response data. CLI diagnostics never echo an untrusted remote
|
|
416
476
|
response body or bearer credential.
|
|
417
477
|
|
|
418
|
-
Inspect the account
|
|
478
|
+
Inspect the account, then target the Map shown in the dashboard:
|
|
419
479
|
|
|
420
480
|
```sh
|
|
421
481
|
npx tileflow whoami --json
|
|
422
|
-
npx tileflow deploy
|
|
423
|
-
npx tileflow status
|
|
482
|
+
npx tileflow deploy --map-id map_AbCdEfGhIjKlMnOp
|
|
483
|
+
npx tileflow status --map-id map_AbCdEfGhIjKlMnOp
|
|
424
484
|
npx tileflow logout
|
|
425
485
|
```
|
|
426
486
|
|
|
427
|
-
|
|
428
|
-
|
|
487
|
+
The dashboard creates the Map and browser-access policy before repository setup. Keep that exact
|
|
488
|
+
Map ID in the deploy action. If the config contains several maps, select the authored map explicitly:
|
|
429
489
|
|
|
430
490
|
```sh
|
|
431
491
|
npx tileflow deploy \
|
|
432
|
-
--
|
|
433
|
-
--
|
|
492
|
+
--map-id map_AbCdEfGhIjKlMnOp \
|
|
493
|
+
--map store-locator
|
|
434
494
|
```
|
|
435
495
|
|
|
436
|
-
The
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
496
|
+
The Map ID is a public destination, not a credential. A successful server-confirmed deploy keeps
|
|
497
|
+
unrelated manifest entries and records that Map's stable ID, hosted theme URLs, World `v1`
|
|
498
|
+
generation, and fixed session usage mode. Browser access remains server-owned and is never read
|
|
499
|
+
from or written to repository configuration. Do not add an API key or payment authority to a copied
|
|
500
|
+
prompt.
|
|
440
501
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
502
|
+
Team tileset commands exchange the same account session for a separate Team-scoped data capability;
|
|
503
|
+
it carries no Map authority. Inspect and preview remain account-free:
|
|
504
|
+
|
|
505
|
+
```sh
|
|
506
|
+
npx tileflow tileset inspect ./data/stores.pmtiles --json
|
|
507
|
+
npx tileflow tileset inspect ./data/stores.pmtiles \
|
|
508
|
+
--include-values category,status --json
|
|
509
|
+
npx tileflow tileset publish ./data/stores.pmtiles \
|
|
510
|
+
--id stores --team @acme --attribution 'Store data © Example' --json
|
|
511
|
+
npx tileflow tileset list --team @acme --json
|
|
512
|
+
npx tileflow tileset status stores --team @acme --json
|
|
513
|
+
```
|
|
447
514
|
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
515
|
+
Inspection schema 1 separates authoritative PMTiles/TileJSON declarations from bounded MVT
|
|
516
|
+
observations. Sampled fields report present/missing feature counts, observed distinct-value counts,
|
|
517
|
+
numeric min/max, and truncation. Raw primitive values remain absent unless `--include-values`
|
|
518
|
+
explicitly selects their comma-separated field names; the command emits at most 16 values per field,
|
|
519
|
+
32 selected fields, and 256 characters per string. `--no-sample` returns only authoritative metadata
|
|
520
|
+
and cannot be combined with value inspection. Directory traversal recomputes addressed-tile and
|
|
521
|
+
tile-entry counts; the header's tile-content count is reported only as a nullable declaration and is
|
|
522
|
+
not treated as authority.
|
|
523
|
+
|
|
524
|
+
`publish --id` names a Team-local logical resource; Tileflow owns its opaque delivery ID. The
|
|
525
|
+
command validates the archive locally before authentication, hashes it in fixed 16 MiB parts, then
|
|
526
|
+
uploads at most four parts concurrently without buffering the complete file. Interrupted sessions
|
|
527
|
+
remain resumable for 24 hours: rerunning the same command reconciles server receipts and transfers
|
|
528
|
+
only missing parts. Normal Queue initialization is polled for at most two minutes before the command
|
|
529
|
+
returns a resumable availability error. Retryable transfer failures receive fresh short-lived authorization; a changed
|
|
530
|
+
local file stops before completion. Free accepts versions through exactly 2,000,000,000 bytes and
|
|
531
|
+
Starter through exactly 4,000,000,000 bytes, subject to the Team's hosted-storage capacity.
|
|
532
|
+
|
|
533
|
+
Publication completes only after server-side integrity and PMTiles validation. A compatible new
|
|
534
|
+
version becomes current at the same stable TileJSON and tile URLs, so newly resolved browser
|
|
535
|
+
requests see it without creating a Map deployment. Purge requires `--confirm <exact-id>` and fails
|
|
536
|
+
with bounded dependency context while any retained Map deployment uses the resource. Automation may set a Team data
|
|
537
|
+
`TILEFLOW_API_KEY`; that key selects its Team, so commands omit `--team` and never load account
|
|
538
|
+
state.
|
|
539
|
+
|
|
540
|
+
`tileset publish --json` emits schema version 2 with the Team selector when known, logical and
|
|
541
|
+
opaque tileset identities, immutable version ID and number, exact byte count, content-hash
|
|
542
|
+
algorithm/hash, final state, and `changed` or `unchanged` publication result. It never emits the
|
|
543
|
+
local path, upload session, storage key, signed URL, ETag, credential, or retry details.
|
|
544
|
+
|
|
545
|
+
An explicit key or `TILEFLOW_API_KEY` never uses the saved account session. The deploy API rejects a
|
|
546
|
+
`--map-id` that does not match the key. Read-only hosted icon comparison validates the same binding
|
|
547
|
+
before loading its baseline.
|
|
451
548
|
|
|
452
549
|
The CI key grants only `styles:write` and `status:read`. It cannot upload
|
|
453
550
|
datasets or render images. Give it an expiration, rotate the repository secret
|
|
@@ -464,7 +561,7 @@ and do not pass keys through the `--api-key` command line in CI.
|
|
|
464
561
|
|
|
465
562
|
The [deploy documentation](https://tileflow.dev/docs/deploy) contains copyable
|
|
466
563
|
GitHub Actions and GitLab CI workflows. Both use `npm ci`, the committed
|
|
467
|
-
lockfile, and the
|
|
564
|
+
lockfile, and the repository-local CLI. GitHub exposes the key only to its deploy
|
|
468
565
|
step. GitLab variables are job-scoped, so its example validates in a keyless job
|
|
469
566
|
and deploys in a protected `production` job; the locked install and runner are
|
|
470
567
|
part of that trusted job boundary. Both serialize publications and intentionally
|
|
@@ -487,15 +584,16 @@ Invalid explicit values fail before a network write. Provider metadata that is
|
|
|
487
584
|
missing, malformed, or too long is omitted. Secrets and the complete
|
|
488
585
|
environment are never logged.
|
|
489
586
|
|
|
490
|
-
|
|
587
|
+
A separate app-build step is absent from the minimal workflows. Self-hosted build and deploy emit the same
|
|
491
588
|
runtime manifest version 1 shape; Hosted fields are optional identity metadata on its map/theme
|
|
492
589
|
entries. Filesystem build writers refuse to replace a manifest carrying Hosted metadata by default,
|
|
493
590
|
and deploy refuses to replace a purely local manifest. Prefer `emitBuildArtifacts: false` or
|
|
494
591
|
separate output paths when the app deliberately packages a deploy manifest. The explicit
|
|
495
592
|
`overwriteHostedManifest: true` build option and
|
|
496
593
|
`tileflow deploy --overwrite-self-hosted-manifest` flag authorize that destination replacement. A
|
|
497
|
-
retry of the same compiled theme family
|
|
498
|
-
|
|
594
|
+
retry of the same compiled theme family reuses its deployment version and prints `Unchanged`;
|
|
595
|
+
changed cartography prints `Published` with a new version. Allowed websites is managed separately
|
|
596
|
+
in Tileflow and is never read from repository config. The
|
|
499
597
|
fingerprint binds resource references, not the changing bytes behind referenced
|
|
500
598
|
glyph or sprite URLs. Every theme of one logical map publishes atomically; separate maps can still
|
|
501
599
|
partially succeed when no remote batch release is used.
|
|
@@ -535,21 +633,13 @@ before deletion. Upload success must confirm the submitted `contentHash`, exact
|
|
|
535
633
|
generated byte total, one opaque `icp_<id>`, and the corresponding query-free
|
|
536
634
|
`/sprites/<id>/sprite` URL. The CLI rejects any missing or divergent field before using that URL.
|
|
537
635
|
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
hashes, MIME/signature agreement, licenses, and immutable public base URL; the CLI then binds
|
|
542
|
-
`tileflow:fontFaces` to the returned `.../font-bundles/fnb_<id>/fonts/<content-addressed-file>` and
|
|
543
|
-
sends only `fontBundle: {contentHash}` with the Style. Upload success must carry that exact opaque ID
|
|
544
|
-
and base URL; clients never derive a storage URL from the hash. The build manifest records the effective font-byte
|
|
545
|
-
digests, so a claimed hash or a different public URL cannot substitute for the uploaded bytes.
|
|
546
|
-
Hosted's matching rollout candidate persists project ownership, organization quota, deployment
|
|
547
|
-
references, grace-based cleanup, and deletion receipts. This repository contract does not by itself
|
|
548
|
-
establish that the matching Hosted migration and API are already deployed in production.
|
|
636
|
+
Hosted deploy currently rejects local or package-owned web fonts before authentication or remote
|
|
637
|
+
writes. Use self-hosted delivery or an explicit public glyph provider. Enabling managed font bundles
|
|
638
|
+
requires a separately deployed ownership, quota, retention, and immutable-delivery contract.
|
|
549
639
|
|
|
550
640
|
For both managed resource kinds, `assetSetSha256` remains a separate per-map output identity. It
|
|
551
641
|
hashes each generated file's exact portable name, media type, byte count, and SHA-256 using Core's
|
|
552
|
-
asset-set v1 contract; it does not hash only the icon-package
|
|
642
|
+
asset-set v1 contract; it does not hash only the icon-package manifest. Hosted must
|
|
553
643
|
confirm the immutable resource bytes, reconstruct those same per-file identities (including the
|
|
554
644
|
`icons/<mapId>/` prefix), and reject the Style when the submitted build-manifest hash diverges.
|
|
555
645
|
|
|
@@ -606,14 +696,15 @@ source path with normal repository tools only when the pixels themselves are nee
|
|
|
606
696
|
Compare the exported map with its active hosted revision before deciding whether to deploy:
|
|
607
697
|
|
|
608
698
|
```sh
|
|
609
|
-
npx tileflow icons diff --against production
|
|
610
|
-
npx tileflow icons diff --against production --json
|
|
611
|
-
npx tileflow icons diff --against production --report ./icon-diff.html
|
|
699
|
+
npx tileflow icons diff --map-id map_AbCdEfGhIjKlMnOp --against production
|
|
700
|
+
npx tileflow icons diff --map-id map_AbCdEfGhIjKlMnOp --against production --json
|
|
701
|
+
npx tileflow icons diff --map-id map_AbCdEfGhIjKlMnOp --against production --report ./icon-diff.html
|
|
612
702
|
```
|
|
613
703
|
|
|
614
|
-
The command compiles only the exported map, performs
|
|
615
|
-
uploads a package, creates a deployment, or writes the frontend manifest.
|
|
616
|
-
create no files. A requested HTML report adds reads of the baseline's four
|
|
704
|
+
The command compiles only the exported map, performs authenticated read-only control-plane
|
|
705
|
+
requests, and never uploads a package, creates a deployment, or writes the frontend manifest.
|
|
706
|
+
Plain and JSON modes create no files. A requested HTML report adds reads of the baseline's four
|
|
707
|
+
public sprite files and
|
|
617
708
|
embeds verified old/new images in one self-contained file. The report groups exact-cell icon
|
|
618
709
|
previews under `Added`, `Modified`, and `Removed`. Added and removed cards show only the affected
|
|
619
710
|
icon; modified cards compare `Before` with `Next`. A script-free 1x/2x selector defaults to 2x,
|