@tellegen/engine 0.3.0 → 0.4.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.
Files changed (56) hide show
  1. package/README.md +51 -5
  2. package/dist/data/populated_places.json +1 -0
  3. package/dist/generated/{contracts.d.ts → api-types.d.ts} +4 -4
  4. package/dist/generated/api-types.d.ts.map +1 -0
  5. package/dist/generated/api-types.js +8 -0
  6. package/dist/generated/api-types.js.map +1 -0
  7. package/dist/generated/study-schema.d.ts.map +1 -1
  8. package/dist/generated/study-schema.js +2 -2
  9. package/dist/generated/study-schema.js.map +1 -1
  10. package/dist/generated/{study-contracts.d.ts → study-types.d.ts} +1 -1
  11. package/dist/generated/study-types.d.ts.map +1 -0
  12. package/dist/generated/study-types.js +4 -0
  13. package/dist/generated/study-types.js.map +1 -0
  14. package/dist/generated/synth-schema.d.ts +2 -0
  15. package/dist/generated/synth-schema.d.ts.map +1 -0
  16. package/dist/generated/synth-schema.js +3 -0
  17. package/dist/generated/synth-schema.js.map +1 -0
  18. package/dist/generated/synth-types.d.ts +482 -0
  19. package/dist/generated/synth-types.d.ts.map +1 -0
  20. package/dist/generated/synth-types.js +4 -0
  21. package/dist/generated/synth-types.js.map +1 -0
  22. package/dist/host.d.ts +23 -2
  23. package/dist/host.d.ts.map +1 -1
  24. package/dist/host.js +60 -22
  25. package/dist/host.js.map +1 -1
  26. package/dist/index.d.ts +253 -16
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +433 -11
  29. package/dist/index.js.map +1 -1
  30. package/dist/module.d.ts +1 -0
  31. package/dist/module.d.ts.map +1 -1
  32. package/dist/module.js.map +1 -1
  33. package/dist/protocol.d.ts +97 -7
  34. package/dist/protocol.d.ts.map +1 -1
  35. package/dist/protocol.js +96 -6
  36. package/dist/protocol.js.map +1 -1
  37. package/dist/study-document.d.ts +2 -2
  38. package/dist/study-document.d.ts.map +1 -1
  39. package/dist/study-document.js +1 -1
  40. package/dist/study-document.js.map +1 -1
  41. package/dist/wasm-pkg/LICENSE +17 -4
  42. package/dist/wasm-pkg/tellegen.d.ts +171 -6
  43. package/dist/wasm-pkg/tellegen.js +627 -33
  44. package/dist/wasm-pkg/tellegen_bg.wasm +0 -0
  45. package/dist/wasm-pkg/tellegen_bg.wasm.d.ts +32 -2
  46. package/dist/worker.js +10 -7
  47. package/dist/worker.js.map +1 -1
  48. package/package.json +14 -10
  49. package/dist/generated/contracts.d.ts.map +0 -1
  50. package/dist/generated/contracts.js +0 -8
  51. package/dist/generated/contracts.js.map +0 -1
  52. package/dist/generated/study-contracts.d.ts.map +0 -1
  53. package/dist/generated/study-contracts.js +0 -4
  54. package/dist/generated/study-contracts.js.map +0 -1
  55. package/dist/wasm-pkg/LICENSE-APACHE +0 -201
  56. package/dist/wasm-pkg/LICENSE-MIT +0 -19
@@ -0,0 +1,482 @@
1
+ export type AcPfOutcome = "converged" | "not_converged" | "skipped";
2
+ export type AcPfReport = {
3
+ "buses_outside_emergency_band": number;
4
+ "buses_outside_planning_band": number;
5
+ "islands": Array<IslandOutcome>;
6
+ "losses_mw"?: number | null;
7
+ "message"?: string | null;
8
+ "newton_iterations"?: number | null;
9
+ "residual"?: number | null;
10
+ "solve_ms"?: number | null;
11
+ "status": AcPfOutcome;
12
+ "vm_max"?: number | null;
13
+ "vm_min"?: number | null;
14
+ };
15
+ export type BBox = {
16
+ "east": number;
17
+ "north": number;
18
+ "south": number;
19
+ "west": number;
20
+ };
21
+ export type BranchAnnotation = {
22
+ "boundary_role": string; /** 1-based position of this branch among its corridor's circuits (`1..=circuits`); 1 for an HVDC link. */
23
+ "circuit_index": number; /** Parallel circuits in this branch's corridor, this branch included; every branch of a corridor carries the same count. It is the corridor plan's count for a synthetic corridor and for the transformers and connections OpenStreetMap mode adds, and the summed `circuits` tags (else `cables / 3`) of the joined ways for a mapped OpenStreetMap corridor. An HVDC link is one row for all of its circuits. */
24
+ "circuits": number;
25
+ "class_kv": number; /** 1-based branch position. */
26
+ "id": number;
27
+ "is_hvdc": boolean;
28
+ "is_transformer": boolean;
29
+ "length_km": number;
30
+ "osm_ids"?: Array<number>; /** `thermal`, `loadability` (St. Clair), `transformer`, `calibrated`. */
31
+ "rating_basis": string;
32
+ "source": ElementSource;
33
+ "uid": string;
34
+ };
35
+ export type BusAnnotation = {
36
+ "base_kv": number;
37
+ "confidence": number;
38
+ "id": number; /** Index of the electrical island (0 = largest). */
39
+ "island": number;
40
+ "kind": BusKind;
41
+ "name": string;
42
+ "place"?: string | null;
43
+ "population_weight": number;
44
+ "source": ElementSource; /** 0 = highest voltage level. */
45
+ "tier": number;
46
+ "uid": string;
47
+ };
48
+ export type BusKind = "load" | "substation" | "generator" | "converter";
49
+ export type CalibrationOptions = {
50
+ "allow_load_scale"?: boolean;
51
+ "enabled"?: boolean; /** Each iteration is one declared parameter step with an exact DC OPF re-solve. */
52
+ "max_iterations"?: number; /** Override the reference targets. */
53
+ "targets"?: (CalibrationTargets) | (null);
54
+ };
55
+ export type CalibrationParameters = {
56
+ "branch_rating_notches": {
57
+ [key: string]: number;
58
+ }; /** Capacity multiplier per fuel, bounds `[0.8, 1.5]`. */
59
+ "gen_capacity_scale": {
60
+ "coal"?: number;
61
+ "gas"?: number;
62
+ "hydro"?: number;
63
+ "nuclear"?: number;
64
+ "other"?: number;
65
+ "solar"?: number;
66
+ "storage"?: number;
67
+ "wind"?: number;
68
+ }; /** Load multiplier; 1.0 unless `allow_load_scale`. */
69
+ "load_scale": number; /** Rating multiplier per line class (key = class kV), bounds `[0.8, 1.5]`. */
70
+ "rating_scale": {
71
+ [key: string]: number;
72
+ };
73
+ };
74
+ export type CalibrationReport = {
75
+ "final_objective": number;
76
+ "initial_objective": number;
77
+ "iterations": number;
78
+ "parameters": CalibrationParameters;
79
+ "status": CalibrationStatus;
80
+ "steps": Array<CalibrationStep>;
81
+ "targets": CalibrationTargets;
82
+ "terms_final": {
83
+ [key: string]: number;
84
+ };
85
+ "terms_initial": {
86
+ [key: string]: number;
87
+ }; /** Objective weights, declared up front. */
88
+ "weights": {
89
+ [key: string]: number;
90
+ };
91
+ };
92
+ export type CalibrationStatus = ("converged") | ("improved") | ("unchanged") | ("infeasible") | ("disabled");
93
+ export type CalibrationStep = {
94
+ "accepted": boolean;
95
+ "after": number;
96
+ "before": number;
97
+ "dc_status": SolveOutcome;
98
+ "iteration": number;
99
+ "objective_after": number;
100
+ "objective_before": number; /** The parameter changed (`rating_scale[230]`, `gen_capacity_scale[gas]`, `branch_rating_notch[branches:12]`, `load_scale`). */
101
+ "parameter": string;
102
+ "reason": string;
103
+ };
104
+ export type CalibrationTargets = {
105
+ "avg_degree": [number, number]; /** Fraction of branches at or above the loading target in the DC OPF. */
106
+ "binding_fraction": [number, number]; /** Fraction of buses at the highest voltage level. */
107
+ "hv_share": [number, number]; /** 90th percentile branch loading floor (under-utilisation guard). */
108
+ "loading_p90_min": number; /** Branch loading the calibration keeps the worst branch under. */
109
+ "loading_target": number; /** Identifier of the reference set (`reference_stats.json` entry). */
110
+ "set_id": string; /** Where the numbers come from. */
111
+ "source": string;
112
+ };
113
+ export type CostCoefficients = {
114
+ "c0": number;
115
+ "c1": number;
116
+ "c2": number;
117
+ };
118
+ export type CountryDemand = {
119
+ "area_share"?: number | null; /** Country code of the places table (Natural Earth `adm0_a3`). */
120
+ "code": string; /** Population of the country's listed places over its national population, at most 1: the share of its peak that follows its places. */
121
+ "listed_share"?: number | null; /** The country's national peak (annual average load × peak factor), MW; `peak_mw` equals it when the region holds every place and at least 95% of the area of the country. Absent for the world fallback. */
122
+ "national_peak_mw"?: number | null; /** Peak demand of those places, MW. */
123
+ "peak_mw": number;
124
+ "places": number; /** Sum of `pop_max` over those places. */
125
+ "population": number; /** Of `peak_mw`, the part of the country's unlisted demand the region takes: in proportion to the area it covers, never beyond its share of the country's listed population, MW. */
126
+ "unlisted_peak_mw"?: number | null; /** Year of the national figure; absent when the country has no entry and its places drew the world average. */
127
+ "year"?: number | null;
128
+ };
129
+ export type DcOpfReport = {
130
+ "binding_branches": Array<string>;
131
+ "binding_fraction": number; /** Per branch loading keyed by branch uid (the module's identity). */
132
+ "branch_loading"?: {
133
+ [key: string]: number;
134
+ };
135
+ "dispatch_by_fuel_mw": {
136
+ "coal"?: number;
137
+ "gas"?: number;
138
+ "hydro"?: number;
139
+ "nuclear"?: number;
140
+ "other"?: number;
141
+ "solar"?: number;
142
+ "storage"?: number;
143
+ "wind"?: number;
144
+ }; /** HVDC rows replaced by a fixed transfer on the validation copy. */
145
+ "hvdc_as_fixed_transfer": number;
146
+ "islands": Array<IslandOutcome>;
147
+ "iterations"?: number | null;
148
+ "lmp"?: (LmpSummary) | (null); /** Ten bins of width 0.1 from 0; the last bin holds loadings ≥ 0.9. */
149
+ "loading_histogram": Array<number>;
150
+ "loading_mean"?: number | null;
151
+ "loading_p90"?: number | null;
152
+ "max_loading"?: number | null;
153
+ "message"?: string | null;
154
+ "objective"?: number | null;
155
+ "solve_ms"?: number | null;
156
+ "status": SolveOutcome; /** 0 when optimal, absent when infeasible (nothing is invented). */
157
+ "unserved_mw"?: number | null;
158
+ };
159
+ export type DemandBasis = ("national") | ("population") | ("total_mw") | ("default_per_bus");
160
+ export type DemandSpec = ({
161
+ "kind": "population";
162
+ "peak_factor"?: number;
163
+ "per_capita_kw"?: number | null;
164
+ }) | ({
165
+ "kind": "total_mw";
166
+ "mw": number;
167
+ });
168
+ export type DemandTableProvenance = {
169
+ "areas_sha256": string; /** SHA-256 of the admin-0 file the areas were derived from. */
170
+ "areas_source_sha256": string;
171
+ "licence": string; /** Peak demand as a multiple of the annual average load. */
172
+ "peak_factor": number;
173
+ "schema": string; /** SHA-256 of the bundled table. */
174
+ "sha256": string;
175
+ "source": string; /** SHA-256 of the dataset the table was derived from. */
176
+ "source_sha256": string; /** The year most entries report. */
177
+ "year": number;
178
+ };
179
+ export type Density = "low" | "medium" | "high";
180
+ export type ElementAnnotations = {
181
+ "branches": Array<BranchAnnotation>;
182
+ "buses": Array<BusAnnotation>;
183
+ "generators": Array<GeneratorAnnotation>;
184
+ };
185
+ export type ElementSource = ("synthetic" | "osm") | ("makeup") | ("interconnect");
186
+ export type ErrorPayload = {
187
+ "branches"?: number | null;
188
+ "buses"?: number | null;
189
+ "code": string;
190
+ "message": string;
191
+ };
192
+ export type FallbackFrom = {
193
+ "branches"?: number | null;
194
+ "buses"?: number | null;
195
+ "message"?: string | null;
196
+ "reason": FallbackReason;
197
+ "source": Source;
198
+ };
199
+ export type FallbackReason = "osm_insufficient" | "overpass_failed";
200
+ export type FarIslandPolicy = ("cut") | ("keep");
201
+ export type Fidelity = "low" | "high";
202
+ export type Fuel = "gas" | "coal" | "nuclear" | "hydro" | "wind" | "solar" | "storage" | "other";
203
+ export type GenerationReport = {
204
+ "ac_pf"?: (AcPfReport) | (null);
205
+ "calibration"?: (CalibrationReport) | (null);
206
+ "context"?: (RegionContext) | (null);
207
+ "dc_opf"?: (DcOpfReport) | (null);
208
+ "elements"?: (ElementAnnotations) | (null);
209
+ "planning"?: (PlanningReport) | (null);
210
+ "provenance": Provenance;
211
+ "request": SynthRequest;
212
+ "schema": string;
213
+ "stages": Array<StageRecord>;
214
+ "stats"?: (TopologyStats) | (null);
215
+ "warnings": Array<Warning>;
216
+ };
217
+ export type GeneratorAnnotation = {
218
+ "bus": number; /** A synchronous condenser the plan placed for voltage support in a remote pocket: no active power, reactive range only. */
219
+ "condenser"?: boolean;
220
+ "cost": CostCoefficients;
221
+ "fuel": Fuel;
222
+ "makeup": boolean;
223
+ "pmax_mw": number;
224
+ "slack": boolean;
225
+ "uid": string;
226
+ };
227
+ export type IslandOptions = {
228
+ "beyond"?: FarIslandPolicy; /** Landmasses whose nearest buses are closer than this are joined by an interconnect corridor (submarine or overhead), like Sicily or the Danish islands. source: typical AC/HVDC interconnector lengths, ENTSO-E grid map. */
229
+ "max_interconnect_km"?: number;
230
+ };
231
+ export type IslandOutcome = {
232
+ "branches": number;
233
+ "buses": number;
234
+ "generators": number;
235
+ "index": number;
236
+ "load_mw": number;
237
+ "message"?: string | null;
238
+ "status": string;
239
+ };
240
+ export type Limits = {
241
+ "max_area_km2"?: number;
242
+ "max_branch_factor"?: number;
243
+ "max_bus_count"?: number;
244
+ };
245
+ export type LmpSummary = {
246
+ "max": number;
247
+ "mean": number;
248
+ "min": number;
249
+ "spread": number;
250
+ };
251
+ export type OsmIslands = ("connect") | ("cut") | ("keep");
252
+ export type OsmOptions = {
253
+ "clip_buffer_km"?: number; /** Substation and converter elements within this radius collapse into one site. */
254
+ "cluster_radius_m"?: number; /** A DC line end within this distance of a converter snaps to it. */
255
+ "hvdc_snap_km"?: number;
256
+ "islands"?: OsmIslands; /** Fewer branches than this is `OsmInsufficient`. */
257
+ "min_branches"?: number; /** Fewer buses than this is `OsmInsufficient`. */
258
+ "min_buses"?: number; /** A plant within this distance of a site connects there. */
259
+ "plant_snap_km"?: number; /** A line end within this distance of a site snaps to it. */
260
+ "snap_km"?: number; /** Lines and substations below this nominal voltage are distribution and are dropped. */
261
+ "voltage_floor_kv"?: number;
262
+ };
263
+ export type OsmProvenance = {
264
+ "counts": {
265
+ [key: string]: number;
266
+ };
267
+ "document_sha256": string;
268
+ "elements": number;
269
+ "generator": string;
270
+ "timestamp_osm_base"?: string | null;
271
+ };
272
+ export type PlacesProvenance = {
273
+ "count": number;
274
+ "sha256": string;
275
+ };
276
+ export type PlanningReport = {
277
+ "added_level_kv"?: number | null; /** Widest island angle spread of the planning case (DC), degrees. */
278
+ "angle_spread_deg": number; /** Branches the requested branch factor asks for. */
279
+ "branch_target": number; /** Branches in the network. */
280
+ "branches": number;
281
+ "capacitor_banks": number; /** Total capacitor rating, MVAr at 1 pu. */
282
+ "capacitor_mvar": number; /** Circuits added beyond one per corridor because the planning flow needed them. */
283
+ "capacity_circuits": number; /** Corridors at the cap whose planning flow still needs more circuits. */
284
+ "capped_corridors": number; /** Parallel circuits one corridor may hold. */
285
+ "circuit_cap": number; /** False when the plan stopped at its round or circuit cap. */
286
+ "converged": boolean; /** The planning case: `economic_dispatch_at_peak`, the least-cost dispatch of the generators serving peak load on a lossless network with no limits. */
287
+ "dispatch": string; /** Circuits added, heaviest planned loading first, to reach the target. */
288
+ "filler_circuits": number; /** Largest angle difference across one branch in the AC solution of the planning case at the planned voltage profile, degrees. */
289
+ "max_angle_difference_deg": number; /** Most parallel circuits on one corridor. */
290
+ "max_parallel_circuits": number; /** Highest circuit loading in the planning case. */
291
+ "max_planning_loading": number; /** Corridors still above their rating in the planning case. */
292
+ "overloaded_corridors": number; /** Buses raised to the next voltage level because an incident corridor would have needed more than two circuits at the lower one. */
293
+ "promoted_buses": number;
294
+ "reactor_banks": number; /** Total shunt reactor rating, MVAr at 1 pu. */
295
+ "reactor_mvar": number; /** Capacity and stiffening rounds the corridor plan ran (each one DC power flow). */
296
+ "rounds": number; /** Circuits added to hold each island's angle spread within the St. Clair stability margin (44.4°). */
297
+ "stiffening_circuits": number; /** Transformer corridors whose bank the plan enlarged (up to the rating of the line it terminates) before adding circuits. */
298
+ "upsized_transformers": number; /** Share of its rating no circuit may exceed in the planning case. */
299
+ "utilisation_target": number;
300
+ };
301
+ export type Preview = {
302
+ "branches": Array<PreviewBranch>;
303
+ "buses": Array<PreviewBus>;
304
+ "stage": Stage;
305
+ };
306
+ export type PreviewBranch = {
307
+ "base_kv": number;
308
+ "from": number; /** Longitude/latitude polyline. */
309
+ "route": Array<[number, number]>;
310
+ "to": number;
311
+ };
312
+ export type PreviewBus = {
313
+ "base_kv": number;
314
+ "id": number;
315
+ "kind": BusKind;
316
+ "lat": number;
317
+ "lon": number;
318
+ };
319
+ export type Provenance = {
320
+ "demand_table"?: (DemandTableProvenance) | (null);
321
+ "fallback_from"?: (FallbackFrom) | (null);
322
+ "generator": string;
323
+ "osm"?: (OsmProvenance) | (null);
324
+ "parameter_table_version": string;
325
+ "places"?: (PlacesProvenance) | (null);
326
+ "powerio_version": string;
327
+ "request_sha256": string;
328
+ "seed": number; /** Log-normal spread applied to per-branch reactance. */
329
+ "spread_sigma": number;
330
+ "tellegen_synth_version": string;
331
+ "tellegen_version": string;
332
+ "voltage_table"?: (VoltageTableProvenance) | (null);
333
+ };
334
+ export type Quantiles = {
335
+ "max": number;
336
+ "mean": number;
337
+ "min": number;
338
+ "p10": number;
339
+ "p50": number;
340
+ "p90": number;
341
+ };
342
+ export type ReferenceComparison = {
343
+ "metric": string;
344
+ "reference_range": [number, number];
345
+ "value": number;
346
+ "within": boolean;
347
+ };
348
+ export type Region = {
349
+ "geometry": unknown;
350
+ "label"?: string;
351
+ };
352
+ export type RegionContext = {
353
+ "area_km2": number; /** Branches per bus the topology aims at. */
354
+ "branch_factor": number;
355
+ "center_lat": number;
356
+ "center_lon": number;
357
+ "crosses_antimeridian": boolean;
358
+ "demand_basis": DemandBasis; /** The countries behind the demand, largest peak first (national basis only). */
359
+ "demand_by_country"?: Array<CountryDemand>; /** Continuous longitude frame of the region. */
360
+ "frame": BBox;
361
+ "fuel_mix": {
362
+ "coal"?: number;
363
+ "gas"?: number;
364
+ "hydro"?: number;
365
+ "nuclear"?: number;
366
+ "other"?: number;
367
+ "solar"?: number;
368
+ "storage"?: number;
369
+ "wind"?: number;
370
+ };
371
+ "label": string; /** Polygons with usable area. */
372
+ "landmasses": number;
373
+ "peak_demand_mw": number;
374
+ "places_in_region": number; /** Places counted in the region although just outside its polygons: within 15 km of its edge, of a country whose place population it holds at least half of, and moved onto that edge (harbours and estuaries the polygons leave out). */
375
+ "places_snapped": number; /** Sum of `pop_max` over the populated places inside the region. */
376
+ "population_in_region": number; /** Higher AC levels the corridor plan may raise buses to, kV, highest first: the country's levels in service above its ladder, or 765 kV above stated levels. Empty when there is none, as in most of Europe. */
377
+ "promotion_levels_kv"?: Array<number>;
378
+ "target_bus_count": number; /** Where the levels came from. */
379
+ "voltage_basis": VoltageBasis; /** The line class each level takes its per-km parameters from. */
380
+ "voltage_classes_kv": Array<number>; /** The country whose ladder the levels are (table code), or whose missing entry the fallback stands in for; absent for stated levels or a region without places. */
381
+ "voltage_country"?: string | null; /** Nominal levels, highest first; a level the corridor plan added above them (`PlanningReport::added_level_kv`) comes first once it ran. */
382
+ "voltage_levels_kv": Array<number>;
383
+ };
384
+ export type SolveOutcome = "optimal" | "infeasible" | "skipped";
385
+ export type Source = ("synthetic") | ("osm");
386
+ export type Stage = "context" | "site_buses" | "topology" | "electrify" | "dc_opf" | "calibrate" | "ac_pf" | "finalize" | "done";
387
+ export type StageRecord = {
388
+ "counts": {
389
+ [key: string]: number;
390
+ };
391
+ "elapsed_ms"?: number | null;
392
+ "iteration"?: number | null;
393
+ "stage": Stage;
394
+ };
395
+ export type StepOutcome = {
396
+ "done": boolean; /** Stage wall time when the host supplied a clock. */
397
+ "elapsed_ms"?: number | null; /** Calibration iteration (1-based) when `stage == Calibrate`. */
398
+ "iteration"?: number | null; /** The stage the next `step()` runs; `None` after `Done`. */
399
+ "next"?: (Stage) | (null); /** True when `preview()` would return something new. */
400
+ "preview_changed": boolean; /** Progress in `[0, 1]`. */
401
+ "progress": number; /** The stage that just ran. */
402
+ "stage": Stage; /** Warnings raised by this stage. */
403
+ "warnings": Array<Warning>;
404
+ };
405
+ export type SynthRequest = {
406
+ "branch_factor"?: number | null;
407
+ "calibration"?: CalibrationOptions;
408
+ "demand"?: DemandSpec;
409
+ "density"?: Density;
410
+ "fallback_from"?: (FallbackFrom) | (null);
411
+ "fidelity"?: Fidelity; /** Capacity shares by fuel; normalised. Empty means the default mix. */
412
+ "fuel_mix"?: {
413
+ "coal"?: number;
414
+ "gas"?: number;
415
+ "hydro"?: number;
416
+ "nuclear"?: number;
417
+ "other"?: number;
418
+ "solar"?: number;
419
+ "storage"?: number;
420
+ "wind"?: number;
421
+ }; /** Number of generating units; otherwise 16% of the buses (at least 3). */
422
+ "generator_count"?: number | null;
423
+ "islands"?: IslandOptions;
424
+ "limits"?: Limits;
425
+ "osm"?: (OsmOptions) | (null); /** Load power factor; `q = p · tan(acos pf)`. */
426
+ "power_factor"?: number;
427
+ "region": Region; /** Installed capacity ≥ (1 + margin) × peak load. */
428
+ "reserve_margin"?: number;
429
+ "seed"?: number;
430
+ "source"?: Source; /** Exact bus count; otherwise `density` × area decides. */
431
+ "target_bus_count"?: number | null;
432
+ "validation"?: ValidationOptions; /** Nominal voltage levels, kV, highest first after resolution. Each level keeps its own kV for the per-unit base and takes the per-km parameters of the nearest line class. Empty (the default) takes the national ladder of the region's dominant country by demand ([`crate::voltage::VoltageLadders`]); a stated list is used as given, and the corridor plan may then add 765 kV above it. */
433
+ "voltage_levels_kv"?: Array<number>;
434
+ };
435
+ export type TopologyStats = {
436
+ "algebraic_connectivity"?: number | null;
437
+ "algebraic_connectivity_converged"?: boolean | null;
438
+ "avg_degree": number;
439
+ "branch_bus_ratio": number;
440
+ "clustering_coefficient": number;
441
+ "connected_components": number; /** `degree_histogram[d]` = number of buses with degree `d`. */
442
+ "degree_histogram": Array<number>; /** Fraction of distinct corridors that are Delaunay edges of the bus points. */
443
+ "delaunay_edge_fraction": number;
444
+ "gen_load_margin": number; /** Fraction of buses at the highest voltage level. */
445
+ "hv_share": number;
446
+ "line_length_km": Quantiles;
447
+ "max_degree": number;
448
+ "max_line_loading"?: number | null; /** Total corridor length over the Euclidean minimum spanning tree length. */
449
+ "mst_length_ratio": number;
450
+ "n_branches": number;
451
+ "n_buses": number;
452
+ "n_generators": number;
453
+ "n_hvdc": number;
454
+ "n_loads": number;
455
+ "n_transformers": number;
456
+ "parallel_branches": number;
457
+ "parallel_corridors": number;
458
+ "reference"?: Array<ReferenceComparison>;
459
+ "total_generation_capacity_mw": number;
460
+ "total_line_length_km": number;
461
+ "total_load_mw": number; /** Buses per nominal voltage (key = kV). */
462
+ "voltage_counts": {
463
+ [key: string]: number;
464
+ };
465
+ };
466
+ export type ValidationOptions = {
467
+ "emergency_band"?: [number, number];
468
+ "run_ac_pf"?: boolean;
469
+ "run_dc_opf"?: boolean; /** Planning voltage band, per unit. */
470
+ "voltage_band"?: [number, number];
471
+ };
472
+ export type VoltageBasis = ("request") | ("country") | ("fallback");
473
+ export type VoltageTableProvenance = {
474
+ "schema": string; /** SHA-256 of the bundled table. */
475
+ "sha256": string;
476
+ "version": string;
477
+ };
478
+ export type Warning = {
479
+ "code": string;
480
+ "message": string;
481
+ };
482
+ //# sourceMappingURL=synth-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"synth-types.d.ts","sourceRoot":"","sources":["../../src/generated/synth-types.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,eAAe,GAAG,SAAS,CAAC;AAEpE,MAAM,MAAM,UAAU,GAAG;IAAE,8BAA8B,EAAE,MAAM,CAAC;IAAC,6BAA6B,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,EAAE,WAAW,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAAE,CAAC;AAE7W,MAAM,MAAM,IAAI,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;CAAE,CAAC;AAEzF,MAAM,MAAM,gBAAgB,GAAG;IAAoF,eAAe,EAAE,MAAM,CAAC,CAAC,0GAA0G;IAAC,eAAe,EAAE,MAAM,CAAC,CAAC,mZAAmZ;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC,CAAC,+BAA+B;IAAC,IAAI,E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AAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC,uCAAuC;IAAC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAAE,CAAC;AAE5O,MAAM,MAAM,YAAY,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AAEpE,MAAM,MAAM,sBAAsB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,oCAAoC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;CAAE,CAAC;AAErI,MAAM,MAAM,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;CAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ // Generated from Rust by synth_schema and generate-synth-types.mjs.
2
+ // Source SHA256: b2d354010a3f758877a42e749b8a52cbf3dd40aada9e9c51a6583f794e2a0068
3
+ export {};
4
+ //# sourceMappingURL=synth-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"synth-types.js","sourceRoot":"","sources":["../../src/generated/synth-types.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,kFAAkF"}
package/dist/host.d.ts CHANGED
@@ -4,9 +4,21 @@
4
4
  * calling thread; it serves environments without workers (SSR, Node) and is
5
5
  * the replay target when the worker errors before its first response — the
6
6
  * failure mode of a browser that cannot run module workers. */
7
- import { type EngineRequest } from "./protocol.js";
7
+ import { type EngineRequest, type EngineValue } from "./protocol.js";
8
+ /** An engine answer with the time the executing thread spent producing it.
9
+ * `engineMs` is null when the host cannot separate it from transfer time. */
10
+ export interface TimedEngineValue {
11
+ value: EngineValue;
12
+ engineMs: number | null;
13
+ }
8
14
  export interface EngineHost {
9
- call(req: EngineRequest): Promise<string | null>;
15
+ /** Where requests execute: a dedicated worker, or the calling thread. A
16
+ * worker host that had to fall back to the calling thread reports
17
+ * `"direct"` from then on, so a caller can say the page may pause. */
18
+ readonly kind: "worker" | "direct";
19
+ call(req: EngineRequest): Promise<EngineValue>;
20
+ /** `call`, also reporting engine-side time for latency breakdowns. */
21
+ callTimed?(req: EngineRequest): Promise<TimedEngineValue>;
10
22
  /** Finish the current exact trial, then preserve a cancelled planning record. */
11
23
  requestStop?(): void;
12
24
  /** Stop this host's current work. Returns false for the direct host, whose
@@ -15,6 +27,8 @@ export interface EngineHost {
15
27
  * state. */
16
28
  cancel?(reason: Error): boolean;
17
29
  }
30
+ /** Run a request and report engine time, on any host. */
31
+ export declare function callTimed(host: EngineHost, req: EngineRequest): Promise<TimedEngineValue>;
18
32
  export declare const directHost: EngineHost;
19
33
  export declare function engineHost(): EngineHost;
20
34
  /** A separate worker host for interruptible long running work. Terminating it
@@ -22,4 +36,11 @@ export declare function engineHost(): EngineHost;
22
36
  * runtime without Worker falls back to synchronous wasm: cancellation then
23
37
  * takes effect after the call returns, before the caller publishes its result. */
24
38
  export declare function isolatedEngineHost(): EngineHost;
39
+ /** The long-lived host for synthetic grid generation: a third worker, so
40
+ * cancelling a generation (which terminates it) never touches the studies of
41
+ * the interactive host, and the places table loads once per worker rather
42
+ * than once per run. Created on first use, dropped by `cancel` or a crash,
43
+ * and created again for the next session. Without Worker support it runs on
44
+ * the calling thread, where a stop takes effect between stages. */
45
+ export declare function synthEngineHost(): EngineHost;
25
46
  //# sourceMappingURL=host.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AAAA;;;;;+DAK+D;AAG/D,OAAO,EAGL,KAAK,aAAa,EAGnB,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACjD,iFAAiF;IACjF,WAAW,CAAC,IAAI,IAAI,CAAC;IACrB;;;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