@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.
- package/README.md +51 -5
- package/dist/data/populated_places.json +1 -0
- package/dist/generated/{contracts.d.ts → api-types.d.ts} +4 -4
- package/dist/generated/api-types.d.ts.map +1 -0
- package/dist/generated/api-types.js +8 -0
- package/dist/generated/api-types.js.map +1 -0
- package/dist/generated/study-schema.d.ts.map +1 -1
- package/dist/generated/study-schema.js +2 -2
- package/dist/generated/study-schema.js.map +1 -1
- package/dist/generated/{study-contracts.d.ts → study-types.d.ts} +1 -1
- package/dist/generated/study-types.d.ts.map +1 -0
- package/dist/generated/study-types.js +4 -0
- package/dist/generated/study-types.js.map +1 -0
- package/dist/generated/synth-schema.d.ts +2 -0
- package/dist/generated/synth-schema.d.ts.map +1 -0
- package/dist/generated/synth-schema.js +3 -0
- package/dist/generated/synth-schema.js.map +1 -0
- package/dist/generated/synth-types.d.ts +482 -0
- package/dist/generated/synth-types.d.ts.map +1 -0
- package/dist/generated/synth-types.js +4 -0
- package/dist/generated/synth-types.js.map +1 -0
- package/dist/host.d.ts +23 -2
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +60 -22
- package/dist/host.js.map +1 -1
- package/dist/index.d.ts +253 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +433 -11
- package/dist/index.js.map +1 -1
- package/dist/module.d.ts +1 -0
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js.map +1 -1
- package/dist/protocol.d.ts +97 -7
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +96 -6
- package/dist/protocol.js.map +1 -1
- package/dist/study-document.d.ts +2 -2
- package/dist/study-document.d.ts.map +1 -1
- package/dist/study-document.js +1 -1
- package/dist/study-document.js.map +1 -1
- package/dist/wasm-pkg/LICENSE +17 -4
- package/dist/wasm-pkg/tellegen.d.ts +171 -6
- package/dist/wasm-pkg/tellegen.js +627 -33
- package/dist/wasm-pkg/tellegen_bg.wasm +0 -0
- package/dist/wasm-pkg/tellegen_bg.wasm.d.ts +32 -2
- package/dist/worker.js +10 -7
- package/dist/worker.js.map +1 -1
- package/package.json +14 -10
- package/dist/generated/contracts.d.ts.map +0 -1
- package/dist/generated/contracts.js +0 -8
- package/dist/generated/contracts.js.map +0 -1
- package/dist/generated/study-contracts.d.ts.map +0 -1
- package/dist/generated/study-contracts.js +0 -4
- package/dist/generated/study-contracts.js.map +0 -1
- package/dist/wasm-pkg/LICENSE-APACHE +0 -201
- package/dist/wasm-pkg/LICENSE-MIT +0 -19
package/README.md
CHANGED
|
@@ -17,6 +17,10 @@ import {
|
|
|
17
17
|
The wasm files are resolved relative to the package module. Host apps must serve
|
|
18
18
|
package asset files from `node_modules`.
|
|
19
19
|
|
|
20
|
+
Under a Content Security Policy the engine needs `script-src 'wasm-unsafe-eval'`
|
|
21
|
+
(to compile WebAssembly; never `'unsafe-eval'`) and `worker-src 'self'`: its
|
|
22
|
+
workers are same-origin module workers.
|
|
23
|
+
|
|
20
24
|
## Browser Ingestion
|
|
21
25
|
|
|
22
26
|
Case and JSON entry points accept the original bytes:
|
|
@@ -42,6 +46,38 @@ bare model JSON is now `unknown`; regenerate it as `pio-ir` from source data.
|
|
|
42
46
|
Every API that accepts a byte buffer rejects inputs larger than
|
|
43
47
|
`MAX_ENGINE_INPUT_BYTES` (128 MiB) before worker dispatch.
|
|
44
48
|
|
|
49
|
+
## Synthetic Grid Generation
|
|
50
|
+
|
|
51
|
+
`createSynthSession(request, { osm?, places?, signal? })` generates a
|
|
52
|
+
geo-referenced transmission grid for a region, one stage per `advance()`, on a
|
|
53
|
+
dedicated worker. Request and report types come from `@tellegen/engine/synth`.
|
|
54
|
+
The populated places table ships as `dist/data/populated_places.json`;
|
|
55
|
+
`syntheticPlacesUrl()`, `fetchSyntheticPlaces()` and `loadSyntheticPlaces()`
|
|
56
|
+
locate and load it. The
|
|
57
|
+
[synthetic generation guide](https://eigenergy.github.io/tellegen/synthetic-generation.html)
|
|
58
|
+
describes the stages, the demand model and the evidence.
|
|
59
|
+
|
|
60
|
+
## Data Sources
|
|
61
|
+
|
|
62
|
+
The package ships data from third parties:
|
|
63
|
+
|
|
64
|
+
- **Natural Earth** populated places (`dist/data/populated_places.json`) and
|
|
65
|
+
country areas (compiled into the wasm): public domain,
|
|
66
|
+
[naturalearthdata.com](https://www.naturalearthdata.com/about/terms-of-use/).
|
|
67
|
+
- **Ember**, *Yearly Electricity Data*, through **Our World in Data**,
|
|
68
|
+
*Energy dataset*: national electricity demand, compiled into the wasm.
|
|
69
|
+
Licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/);
|
|
70
|
+
the table keeps each country's latest year, so changes were made. Its
|
|
71
|
+
population column is Our World in Data's series, compiled from the sources
|
|
72
|
+
at [ourworldindata.org/population-sources](https://ourworldindata.org/population-sources).
|
|
73
|
+
- **National transmission voltage levels**, compiled into the wasm from the
|
|
74
|
+
operator, regulator and standards documents each entry cites.
|
|
75
|
+
|
|
76
|
+
Grids generated with `source: "osm"` contain data from OpenStreetMap, ©
|
|
77
|
+
OpenStreetMap contributors, under the ODbL 1.0. The
|
|
78
|
+
[third-party notices](https://eigenergy.github.io/tellegen/third-party-notices.html)
|
|
79
|
+
give the full credits.
|
|
80
|
+
|
|
45
81
|
## Migrating To 0.2
|
|
46
82
|
|
|
47
83
|
- Pass `Uint8Array` to `ingestCase`. For an existing string, use
|
|
@@ -56,20 +92,20 @@ Every API that accepts a byte buffer rejects inputs larger than
|
|
|
56
92
|
`kind: "distribution"` with a `format`; `not-json` is `unknown`; and
|
|
57
93
|
`transmission` and `ambiguous` are additional outcomes.
|
|
58
94
|
|
|
59
|
-
##
|
|
95
|
+
## Generated types
|
|
60
96
|
|
|
61
|
-
|
|
97
|
+
`ENGINE_VERSION` is the package version. `API_SOURCE_SHA256` records the `crates/tellegen/src/api.rs` content used to generate `src/generated/api-types.ts`.
|
|
62
98
|
|
|
63
99
|
Run the generator after Rust API changes:
|
|
64
100
|
|
|
65
101
|
```sh
|
|
66
|
-
npm run
|
|
102
|
+
npm run types
|
|
67
103
|
```
|
|
68
104
|
|
|
69
105
|
CI runs `npm run build:engine` from the repository root, and that runs
|
|
70
|
-
`
|
|
106
|
+
`types:check`. Stale generated types fail the build.
|
|
71
107
|
|
|
72
|
-
Breaking
|
|
108
|
+
Breaking changes to the generated types:
|
|
73
109
|
|
|
74
110
|
- Removing or renaming exported request or response fields.
|
|
75
111
|
- Changing field units, enum tags, formulation ids, solve status tags, or sensitivity operand/parameter shapes.
|
|
@@ -95,3 +131,13 @@ npm run pack:engine
|
|
|
95
131
|
Svelte package. It releases through Changesets with the other npm packages. The
|
|
96
132
|
hosted demo under `apps/web` is private and consumes `@tellegen/svelte` through
|
|
97
133
|
the same workspace file dependency used by the local examples.
|
|
134
|
+
|
|
135
|
+
## Citing
|
|
136
|
+
|
|
137
|
+
If you use this package in published work, please cite the tellegen paper:
|
|
138
|
+
Samuel Talkington, Frederik Geth, Qian Zhang, Le Xie, and Skyler Liu. 2026.
|
|
139
|
+
*Interactive Power Flow in the Browser*. The Inaugural ACM Conference on Digital
|
|
140
|
+
Transformation (ACM DXConf 2026), Ann Arbor, MI, USA.
|
|
141
|
+
[doi:10.1145/3847238.3849038](https://doi.org/10.1145/3847238.3849038). The
|
|
142
|
+
[repository README](https://github.com/eigenergy/tellegen#citing) has the BibTeX
|
|
143
|
+
entry.
|