@diagrammo/dgmo 0.65.0 → 0.67.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.
@@ -0,0 +1,139 @@
1
+ import { P as PaletteConfig } from './tag-groups-NUA2F1I5.js';
2
+ import { A as AirportData, G as Gazetteer, R as RegionName } from './d3-Bfhj-XBX.js';
3
+
4
+ /**
5
+ * All built-in palettes, keyed by camelCase id. Use directly with render():
6
+ *
7
+ * await render(text, { palette: palettes.catppuccin });
8
+ *
9
+ * For preference/settings storage, the `.id` field of each entry is the
10
+ * canonical string (e.g. `'tokyo-night'`, `'nord'`) — that's the wire format
11
+ * used by share URLs and the CLI `--palette` flag.
12
+ */
13
+ declare const palettes: {
14
+ readonly atlas: PaletteConfig;
15
+ readonly blueprint: PaletteConfig;
16
+ readonly slate: PaletteConfig;
17
+ readonly tidewater: PaletteConfig;
18
+ readonly nord: PaletteConfig;
19
+ readonly catppuccin: PaletteConfig;
20
+ readonly tokyoNight: PaletteConfig;
21
+ };
22
+
23
+ interface MapPlaceCompletion {
24
+ /** Canonical display name (original casing), e.g. `Portland`. */
25
+ readonly name: string;
26
+ /** Text to insert. ISO-qualified (`Portland US-OR`) iff the name is
27
+ * ambiguous in the gazetteer; bare otherwise (disambiguate-once, §24B.8). */
28
+ readonly insert: string;
29
+ /** Menu label (`Portland — US-OR` when ambiguous, else `Portland`). */
30
+ readonly label: string;
31
+ /** Secondary detail, e.g. `US-OR · 652,503`. */
32
+ readonly detail: string;
33
+ readonly iso: string;
34
+ readonly sub?: string;
35
+ readonly pop: number;
36
+ /** `'airport'` for IATA-code entries (icon/grouping affordance); absent or
37
+ * `'city'` for gazetteer cities. Cities rank above airports for a shared
38
+ * prefix so ~1500 codes never bury city names (ADR-5). */
39
+ readonly kind?: 'city' | 'airport';
40
+ }
41
+ interface MapCompletionOptions {
42
+ /** Max results (default 12). */
43
+ readonly limit?: number;
44
+ /** IATA-coded airports (`airports.json`). When supplied, airport codes
45
+ * matching the prefix are offered as a second (post-city) group. Optional —
46
+ * absent (old DI bundles / no asset) just yields city-only completions. */
47
+ readonly airports?: AirportData;
48
+ /** Resolver-inferred map scope (country `US` or subdivision `US-CA`). Biases
49
+ * airport ranking so in-region airports sort above out-of-region same-prefix
50
+ * ones (ADR-6). Pure rank, never a filter — cross-region airports still
51
+ * appear. App passes the document's inferred scope in (Slice 2). */
52
+ readonly scopeISO?: string;
53
+ }
54
+ /**
55
+ * Prefix-match city names + alternate-name aliases against the gazetteer,
56
+ * rank by population (desc; stable tie-break by gazetteer index), and emit
57
+ * ISO-qualified insert text only for ambiguous (same-named) places.
58
+ *
59
+ * Pure + deterministic. Empty/blank query → `[]` (the caller gates min length).
60
+ */
61
+ declare function completeMapPlaces(query: string, gazetteer: Gazetteer, opts?: MapCompletionOptions): MapPlaceCompletion[];
62
+ /** A POI search hit — a city or airport the resolver can resolve, with the
63
+ * exact `token` to paste into DGMO (a `poi`/route endpoint). Powers the CLI
64
+ * `dgmo map search` command and the MCP `lookup_map_location` tool, so authors
65
+ * (and AI agents) can DISCOVER valid place tokens instead of guessing — e.g.
66
+ * learn that "New York" must be `New York City` and that `JFK` is bundled. */
67
+ interface MapLocationMatch {
68
+ /** Canonical display name (cities) or full airport name. */
69
+ readonly name: string;
70
+ /** Exact text to use in DGMO. Cities: the name, ISO-qualified when ambiguous
71
+ * (`Portland US-OR`). Airports: the upper-case IATA code (`JFK`). */
72
+ readonly token: string;
73
+ readonly kind: 'city' | 'airport';
74
+ readonly iso: string;
75
+ readonly sub?: string;
76
+ /** City population (0 for airports). */
77
+ readonly pop: number;
78
+ /** Human detail, e.g. `US-OR · 652,503` or `Airport · John F Kennedy Intl`. */
79
+ readonly detail: string;
80
+ }
81
+ /**
82
+ * Substring-search cities + airports for a discovery surface (CLI / MCP), so an
83
+ * author can find the exact token the resolver expects. Unlike
84
+ * {@link completeMapPlaces} (prefix-only, editor type-ahead), this matches
85
+ * anywhere in a city name OR an airport code/name, so "york" finds
86
+ * `New York City` and "kennedy" finds `JFK`.
87
+ *
88
+ * Ranking: exact-name (or exact-IATA) → prefix → substring; within a tier,
89
+ * cities by population desc (deterministic index tie-break), cities before
90
+ * airports. Pure + deterministic. Empty query → `[]`.
91
+ */
92
+ declare function searchMapLocations(query: string, gazetteer: Gazetteer, opts?: {
93
+ readonly limit?: number;
94
+ readonly airports?: AirportData;
95
+ }): MapLocationMatch[];
96
+ interface MapRegionCompletion {
97
+ /** Display name = insert text (the resolver disambiguates cross-layer
98
+ * collisions like Georgia by map scope, §24B.8). */
99
+ readonly name: string;
100
+ /** ISO 3166-1/3166-2 id. */
101
+ readonly iso: string;
102
+ readonly layer: 'country' | 'us-state';
103
+ /** Secondary detail, e.g. `US state · US-CA` or `Country · DE`. */
104
+ readonly detail: string;
105
+ }
106
+ /**
107
+ * Prefix-match fill-able region names (countries + US states) for region-fill
108
+ * lines. Matches the folded display name OR the ISO code; deterministic
109
+ * (alphabetical by name, then layer). Pure. Empty query → `[]`.
110
+ *
111
+ * `regions` is injected (the `region-names.json` asset, shipped in dist/map-data
112
+ * alongside the gazetteer). Cross-layer same-name (Georgia: country GE + state
113
+ * US-GA) yields both entries, distinguished by `detail`.
114
+ */
115
+ declare function completeMapRegions(query: string, regions: readonly RegionName[], opts?: MapCompletionOptions): MapRegionCompletion[];
116
+
117
+ /**
118
+ * Theme — render mode flag. Selects which palette variant the renderer uses
119
+ * for background and text:
120
+ * - 'light' → palette.light colors
121
+ * - 'dark' → palette.dark colors
122
+ * - 'transparent' → no background fill (for embedding in colored containers)
123
+ */
124
+ type Theme = 'light' | 'dark' | 'transparent';
125
+ /**
126
+ * `themes` namespace — use with render() options for a typed handle:
127
+ *
128
+ * await render(text, { theme: themes.dark });
129
+ *
130
+ * Passing the raw string `'dark'` also works (the underlying type is the
131
+ * string-literal union); the namespace is the conventional path.
132
+ */
133
+ declare const themes: {
134
+ readonly light: "light";
135
+ readonly dark: "dark";
136
+ readonly transparent: "transparent";
137
+ };
138
+
139
+ export { type MapCompletionOptions as M, type Theme as T, type MapLocationMatch as a, type MapPlaceCompletion as b, type MapRegionCompletion as c, completeMapPlaces as d, completeMapRegions as e, palettes as p, searchMapLocations as s, themes as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diagrammo/dgmo",
3
- "version": "0.65.0",
3
+ "version": "0.67.0",
4
4
  "description": "DGMO diagram markup language — parser, renderer, and color system",
5
5
  "license": "MIT",
6
6
  "author": "Diagrammo LLC",