@elaraai/east-node-cli 0.0.1-beta.8 → 1.0.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/CLA.md +1 -1
- package/CONTRIBUTING.md +3 -3
- package/LICENSE.md +15 -666
- package/README.md +50 -14
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +49 -18
- package/dist/cli.js.map +1 -1
- package/dist/loader.d.ts +14 -1
- package/dist/loader.d.ts.map +1 -1
- package/dist/loader.js +35 -1
- package/dist/loader.js.map +1 -1
- package/dist/runner.d.ts +1 -8
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +98 -63
- package/dist/runner.js.map +1 -1
- package/dist/snapshot.d.ts +19 -0
- package/dist/snapshot.d.ts.map +1 -0
- package/dist/snapshot.js +116 -0
- package/dist/snapshot.js.map +1 -0
- package/package.json +17 -20
- package/dist/tsconfig.tsbuildinfo +0 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](LICENSE.md)
|
|
6
6
|
[](https://nodejs.org)
|
|
7
7
|
|
|
8
|
-
**East Node CLI** provides a command-line interface for executing compiled [East](https://github.com/elaraai/
|
|
8
|
+
**East Node CLI** provides a command-line interface for executing compiled [East](https://github.com/elaraai/east-workspace/tree/main/libs/east) IR programs using Node.js platform implementations.
|
|
9
9
|
|
|
10
10
|
## Installation
|
|
11
11
|
|
|
@@ -112,6 +112,22 @@ Any npm package can provide platform functions by following this convention:
|
|
|
112
112
|
|
|
113
113
|
See the [design document](../../docs/east-node-cli-design.md) for details.
|
|
114
114
|
|
|
115
|
+
## Claude Code plugin
|
|
116
|
+
|
|
117
|
+
The East ecosystem also ships a [Claude Code](https://claude.com/claude-code) plugin — East language skills, example search, and preemptive diagnostics for East code — installed separately from the `elaraai` marketplace:
|
|
118
|
+
|
|
119
|
+
```text
|
|
120
|
+
# Inside Claude Code
|
|
121
|
+
/plugin marketplace add elaraai/east-workspace
|
|
122
|
+
/plugin install east@elaraai
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# From a terminal
|
|
127
|
+
claude plugin marketplace add elaraai/east-workspace
|
|
128
|
+
claude plugin install east@elaraai
|
|
129
|
+
```
|
|
130
|
+
|
|
115
131
|
## License
|
|
116
132
|
|
|
117
133
|
Dual-licensed:
|
|
@@ -121,31 +137,47 @@ Dual-licensed:
|
|
|
121
137
|
|
|
122
138
|
### Ecosystem
|
|
123
139
|
|
|
124
|
-
- **[East
|
|
125
|
-
- [@elaraai/east
|
|
126
|
-
|
|
140
|
+
- **[East](https://github.com/elaraai/east-workspace/tree/main/libs/east)**: Statically typed, expression-based language with serializable IR. Run portable logic across TypeScript, Python, C, and other runtimes.
|
|
141
|
+
- [@elaraai/east](https://www.npmjs.com/package/@elaraai/east): Core language SDK with type system, expressions, and reference JS compiler
|
|
142
|
+
|
|
143
|
+
- **[East Node](https://github.com/elaraai/east-workspace/tree/main/libs/east-node)**: Node.js platform functions for I/O, databases, and system operations.
|
|
144
|
+
- [@elaraai/east-node-std](https://www.npmjs.com/package/@elaraai/east-node-std): Console, FileSystem, Fetch, Crypto, Time, Path, Random
|
|
145
|
+
- [@elaraai/east-node-io](https://www.npmjs.com/package/@elaraai/east-node-io): SQLite, PostgreSQL, MySQL, MongoDB, Redis, S3, FTP, SFTP, XLSX, XML, compression
|
|
127
146
|
- [@elaraai/east-node-cli](https://www.npmjs.com/package/@elaraai/east-node-cli): CLI for running East IR programs in Node.js
|
|
128
147
|
|
|
129
|
-
- **[East
|
|
130
|
-
-
|
|
148
|
+
- **[East C](https://github.com/elaraai/east-workspace/tree/main/libs/east-c)**: C11 native runtime for executing East IR. Tarballed for `linux-x64` and `linux-arm64`, attached to each GitHub Release.
|
|
149
|
+
- `east-c`: Core runtime — type system, IR interpreter, 200+ builtins, serialization (Beast2, JSON, CSV, East text)
|
|
150
|
+
- `east-c-std`: Console, FileSystem, Fetch, Crypto, Time, Path, Random
|
|
151
|
+
- `east-c-cli`: CLI for running East IR programs natively
|
|
152
|
+
|
|
153
|
+
- **[East Python](https://github.com/elaraai/east-workspace/tree/main/libs/east-py)**: Python runtime, standard platform, I/O, and data-science platform functions. Published to PyPI.
|
|
154
|
+
- [east-py](https://pypi.org/project/east-py/): Core Python runtime — type system, IR compiler, 212+ builtins, Cython-accelerated hot paths
|
|
155
|
+
- [east-py-std](https://pypi.org/project/east-py-std/): Console, FileSystem, Fetch, Crypto, Time, Path, Random
|
|
156
|
+
- [east-py-io](https://pypi.org/project/east-py-io/): SQLite, PostgreSQL, MySQL, MongoDB, Redis, S3, FTP, SFTP, XLSX, XML, compression
|
|
157
|
+
- [east-py-cli](https://pypi.org/project/east-py-cli/): CLI for running East IR programs in Python
|
|
158
|
+
- [east-py-datascience](https://pypi.org/project/east-py-datascience/) (PyPI) + [@elaraai/east-py-datascience](https://www.npmjs.com/package/@elaraai/east-py-datascience) (npm): Optimization (MADS, Optuna, ALNS, GoogleOR), ML (XGBoost, LightGBM, NGBoost, PyTorch, Lightning, GP), Bayesian inference (PyMC), explainability (SHAP), conformal prediction (MAPIE)
|
|
131
159
|
|
|
132
|
-
- **[East UI](https://github.com/elaraai/east-ui)**:
|
|
160
|
+
- **[East UI](https://github.com/elaraai/east-workspace/tree/main/libs/east-ui)**: Typed UI component definitions and React renderer, plus VS Code preview.
|
|
133
161
|
- [@elaraai/east-ui](https://www.npmjs.com/package/@elaraai/east-ui): 50+ typed UI components for layouts, forms, charts, tables, dialogs
|
|
134
|
-
- [@elaraai/east-ui-components](https://www.npmjs.com/package/@elaraai/east-ui-components): React renderer with Chakra UI styling
|
|
162
|
+
- [@elaraai/east-ui-components](https://www.npmjs.com/package/@elaraai/east-ui-components): React renderer with Chakra UI v3 styling
|
|
163
|
+
- [@elaraai/e3-ui](https://www.npmjs.com/package/@elaraai/e3-ui): e3 + UI bridge — Data bindings, `e3.ui()` task, manifest
|
|
164
|
+
- [@elaraai/e3-ui-components](https://www.npmjs.com/package/@elaraai/e3-ui-components): React Query hooks and preview components for the e3 API
|
|
165
|
+
- [east-ui-preview](https://marketplace.visualstudio.com/items?itemName=ElaraAI.east-ui-preview): VS Code extension for live East UI component preview
|
|
135
166
|
|
|
136
|
-
- **[e3
|
|
167
|
+
- **[e3 — East Execution Engine](https://github.com/elaraai/east-workspace/tree/main/libs/e3)**: Durable execution engine for running East pipelines at scale. Git-like content-addressable storage, automatic memoization, reactive dataflow, real-time monitoring.
|
|
137
168
|
- [@elaraai/e3](https://www.npmjs.com/package/@elaraai/e3): SDK for authoring e3 packages with typed tasks and pipelines
|
|
138
|
-
- [@elaraai/e3-core](https://www.npmjs.com/package/@elaraai/e3-core):
|
|
169
|
+
- [@elaraai/e3-core](https://www.npmjs.com/package/@elaraai/e3-core): Object store, dataflow orchestrator, execution state
|
|
139
170
|
- [@elaraai/e3-types](https://www.npmjs.com/package/@elaraai/e3-types): Shared type definitions for e3 packages
|
|
140
|
-
- [@elaraai/e3-cli](https://www.npmjs.com/package/@elaraai/e3-cli): `e3
|
|
141
|
-
- [@elaraai/e3-api-client](https://www.npmjs.com/package/@elaraai/e3-api-client): HTTP client for remote e3
|
|
171
|
+
- [@elaraai/e3-cli](https://www.npmjs.com/package/@elaraai/e3-cli): `e3 repo`, `e3 package`, `e3 workspace`, `e3 start`, `e3 watch`, `e3 logs` commands
|
|
172
|
+
- [@elaraai/e3-api-client](https://www.npmjs.com/package/@elaraai/e3-api-client): HTTP client for remote e3 repositories
|
|
142
173
|
- [@elaraai/e3-api-server](https://www.npmjs.com/package/@elaraai/e3-api-server): REST API server for e3 repositories
|
|
174
|
+
- [@elaraai/e3-api-tests](https://www.npmjs.com/package/@elaraai/e3-api-tests): Shared API compliance test suites
|
|
143
175
|
|
|
144
176
|
## Links
|
|
145
177
|
|
|
146
178
|
- **Website**: [https://elaraai.com/](https://elaraai.com/)
|
|
147
|
-
- **East Repository**: [https://github.com/elaraai/
|
|
148
|
-
- **Issues**: [https://github.com/elaraai/east-
|
|
179
|
+
- **East Repository**: [https://github.com/elaraai/east-workspace/tree/main/libs/east](https://github.com/elaraai/east-workspace/tree/main/libs/east)
|
|
180
|
+
- **Issues**: [https://github.com/elaraai/east-workspace/issues](https://github.com/elaraai/east-workspace/issues)
|
|
149
181
|
- **Email**: support@elara.ai
|
|
150
182
|
|
|
151
183
|
## About Elara
|
|
@@ -154,4 +186,8 @@ East is developed by [Elara AI Pty Ltd](https://elaraai.com/), an AI-powered pla
|
|
|
154
186
|
|
|
155
187
|
---
|
|
156
188
|
|
|
189
|
+
*Developed by [Elara AI Pty Ltd](https://elaraai.com/).*
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
157
193
|
*Developed by [Elara AI Pty Ltd](https://elaraai.com/)*
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA4HH,wBAAgB,IAAI,IAAI,IAAI,CA4B3B"}
|
package/dist/cli.js
CHANGED
|
@@ -4,34 +4,63 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Command } from 'commander';
|
|
6
6
|
import { createRequire } from 'module';
|
|
7
|
+
import { EastError } from '@elaraai/east/internal';
|
|
7
8
|
import { loadPlatforms, loadPlatformWithMetadata } from './loader.js';
|
|
8
9
|
import { runProgram } from './runner.js';
|
|
10
|
+
import { writeSnapshot, readSnapshot } from './snapshot.js';
|
|
9
11
|
const require = createRequire(import.meta.url);
|
|
10
12
|
const pkg = require('../package.json');
|
|
11
13
|
async function cmdRun(irFile, options) {
|
|
12
|
-
const packages = options.package ?? [];
|
|
13
|
-
if (packages.length === 0) {
|
|
14
|
-
console.error('Error: At least one platform package is required.');
|
|
15
|
-
console.error('Example: east-node run program.beast2 -p @elaraai/east-node-std');
|
|
16
|
-
process.exit(1);
|
|
17
|
-
}
|
|
18
14
|
try {
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
// --from-snapshot is exclusive with <ir_file>, -i, -p
|
|
16
|
+
if (options.fromSnapshot) {
|
|
17
|
+
if (irFile || (options.input && options.input.length > 0) ||
|
|
18
|
+
(options.package && options.package.length > 0)) {
|
|
19
|
+
console.error('Error: --from-snapshot cannot be combined with <ir_file>, -i, or -p');
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
const ex = await readSnapshot(options.fromSnapshot);
|
|
23
|
+
try {
|
|
24
|
+
const platformFns = await loadPlatforms(ex.packages);
|
|
25
|
+
await runProgram(ex.irPath, platformFns, ex.packages, ex.inputPaths, options.output, options.verbose ?? false);
|
|
26
|
+
}
|
|
27
|
+
finally {
|
|
28
|
+
ex.cleanup();
|
|
29
|
+
}
|
|
30
|
+
return;
|
|
21
31
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
32
|
+
if (!irFile) {
|
|
33
|
+
console.error('Error: Missing <ir_file> argument (or use --from-snapshot PATH)');
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
const packages = options.package ?? [];
|
|
37
|
+
if (packages.length === 0) {
|
|
38
|
+
console.error('Error: At least one platform package is required.');
|
|
39
|
+
console.error('Example: east-node run program.beast2 -p @elaraai/east-node-std');
|
|
40
|
+
process.exit(1);
|
|
26
41
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
42
|
+
// Write the snapshot BEFORE execution so crashes still leave the bundle behind.
|
|
43
|
+
if (options.snapshot) {
|
|
44
|
+
await writeSnapshot({
|
|
45
|
+
outPath: options.snapshot,
|
|
46
|
+
irPath: irFile,
|
|
47
|
+
inputPaths: options.input ?? [],
|
|
48
|
+
packages,
|
|
49
|
+
cliVersion: `${pkg.name} ${pkg.version}`,
|
|
50
|
+
});
|
|
51
|
+
if (options.verbose)
|
|
52
|
+
console.error(`Snapshot: ${options.snapshot}`);
|
|
31
53
|
}
|
|
54
|
+
const platformFns = await loadPlatforms(packages);
|
|
55
|
+
await runProgram(irFile, platformFns, packages, options.input ?? [], options.output, options.verbose ?? false);
|
|
32
56
|
}
|
|
33
57
|
catch (err) {
|
|
34
|
-
|
|
58
|
+
if (err instanceof EastError) {
|
|
59
|
+
console.error(`Error: ${err.toString()}`);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
console.error(`Error: ${err.message}`);
|
|
63
|
+
}
|
|
35
64
|
process.exit(1);
|
|
36
65
|
}
|
|
37
66
|
}
|
|
@@ -69,11 +98,13 @@ export function main() {
|
|
|
69
98
|
program
|
|
70
99
|
.command('run')
|
|
71
100
|
.description('Run an East IR program')
|
|
72
|
-
.argument('
|
|
101
|
+
.argument('[ir_file]', 'Path to IR file (.beast2, .beast, .east, or .json)')
|
|
73
102
|
.option('-p, --package <package...>', 'Platform packages to load (can be repeated)')
|
|
74
103
|
.option('-i, --input <file...>', 'Input data files (order matches function parameters)')
|
|
75
104
|
.option('-o, --output <file>', 'Output file path for result')
|
|
76
105
|
.option('-v, --verbose', 'Enable verbose output')
|
|
106
|
+
.option('--snapshot <path>', 'Write a .east-snapshot bundle (IR + inputs + manifest)')
|
|
107
|
+
.option('--from-snapshot <path>', 'Replay from a .east-snapshot bundle (exclusive with <ir_file>, -i, -p)')
|
|
77
108
|
.action(cmdRun);
|
|
78
109
|
program
|
|
79
110
|
.command('version')
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,U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O,GAAG,EAAE,CAAC;gBACX,OAAO,CAAC,GAAG,CAAC,KAAK,OAAO,KAAM,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;YAC3D,CAAC;QACL,CAAC;IACL,CAAC;AACL,CAAC;AAED,MAAM,UAAU,IAAI;IAChB,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAE9B,OAAO;SACF,IAAI,CAAC,WAAW,CAAC;SACjB,WAAW,CAAC,sDAAsD,CAAC;SACnE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAE1B,OAAO;SACF,OAAO,CAAC,KAAK,CAAC;SACd,WAAW,CAAC,wBAAwB,CAAC;SACrC,QAAQ,CAAC,WAAW,EAAE,oDAAoD,CAAC;SAC3E,MAAM,CAAC,4BAA4B,EAAE,6CAA6C,CAAC;SACnF,MAAM,CAAC,uBAAuB,EAAE,sDAAsD,CAAC;SACvF,MAAM,CAAC,qBAAqB,EAAE,6BAA6B,CAAC;SAC5D,MAAM,CAAC,eAAe,EAAE,uBAAuB,CAAC;SAChD,MAAM,CAAC,mBAAmB,EAAE,wDAAwD,CAAC;SACrF,MAAM,CAAC,wBAAwB,EAC5B,wEAAwE,CAAC;SAC5E,MAAM,CAAC,MAAM,CAAC,CAAC;IAEpB,OAAO;SACF,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,0BAA0B,CAAC;SACvC,MAAM,CAAC,4BAA4B,EAAE,4BAA4B,CAAC;SAClE,MAAM,CAAC,UAAU,CAAC,CAAC;IAExB,OAAO,CAAC,KAAK,EAAE,CAAC;AACpB,CAAC"}
|
package/dist/loader.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
3
|
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
4
|
*/
|
|
5
|
-
import { type EastTypeValue } from '@elaraai/east';
|
|
5
|
+
import { EastIR, AsyncEastIR, type EastTypeValue } from '@elaraai/east';
|
|
6
6
|
import type { PlatformFunction, IR, ValueTypeOf } from '@elaraai/east/internal';
|
|
7
7
|
/**
|
|
8
8
|
* Metadata about a loaded platform package.
|
|
@@ -48,10 +48,23 @@ export declare function loadPlatforms(packageNames: string[]): Promise<PlatformF
|
|
|
48
48
|
* - `.east` - Text East format
|
|
49
49
|
* - `.json` - JSON format
|
|
50
50
|
*
|
|
51
|
+
* Source maps are NOT returned from this function — use {@link loadEastIR}
|
|
52
|
+
* if you need the source map along with the IR.
|
|
53
|
+
*
|
|
51
54
|
* @param filePath - Path to the IR file
|
|
52
55
|
* @returns Parsed IR (FunctionIR or AsyncFunctionIR)
|
|
53
56
|
*/
|
|
54
57
|
export declare function loadIR(filePath: string): ValueTypeOf<IR>;
|
|
58
|
+
/**
|
|
59
|
+
* Loads an IR file and returns an EastIR / AsyncEastIR bundle (IR + source
|
|
60
|
+
* map). Prefer this over {@link loadIR} when the caller will compile + run
|
|
61
|
+
* the IR, so that error locations resolve end-to-end.
|
|
62
|
+
*
|
|
63
|
+
* Supports `.beast2` / `.beast` (source map read from the blob), `.json`
|
|
64
|
+
* (source map read from the `{ir, source_map}` wrapper format), and `.east`
|
|
65
|
+
* (no source map available — field stays null).
|
|
66
|
+
*/
|
|
67
|
+
export declare function loadEastIR(filePath: string): EastIR<any, any> | AsyncEastIR<any, any>;
|
|
55
68
|
/**
|
|
56
69
|
* Loads input data from a file.
|
|
57
70
|
*
|
package/dist/loader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAQH,MAAM,EACN,WAAW,EACX,KAAK,aAAa,EACrB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAahF;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,sBAAsB;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,GAAG,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAoCnF;AAED;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAgB7F;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CASvF;AAmDD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAAC,EAAE,CAAC,CAgCxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAuBrF;AAED;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAoBxE"}
|
package/dist/loader.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { readFileSync } from 'fs';
|
|
6
6
|
import { createRequire } from 'module';
|
|
7
7
|
import { extname } from 'path';
|
|
8
|
-
import { IRType, decodeBeast2For, decodeBeast2, decodeEastFor, decodeJSONFor, } from '@elaraai/east';
|
|
8
|
+
import { IRType, decodeBeast2For, decodeBeast2, decodeEastFor, decodeJSONFor, decodeEastIR, decodeAsyncEastIR, EastIR, AsyncEastIR, } from '@elaraai/east';
|
|
9
9
|
const require = createRequire(import.meta.url);
|
|
10
10
|
// Decoder for IR from beast2 format (self-describing)
|
|
11
11
|
const decodeIRFromBeast2 = decodeBeast2For(IRType);
|
|
@@ -138,6 +138,9 @@ function getFileFormat(filePath) {
|
|
|
138
138
|
* - `.east` - Text East format
|
|
139
139
|
* - `.json` - JSON format
|
|
140
140
|
*
|
|
141
|
+
* Source maps are NOT returned from this function — use {@link loadEastIR}
|
|
142
|
+
* if you need the source map along with the IR.
|
|
143
|
+
*
|
|
141
144
|
* @param filePath - Path to the IR file
|
|
142
145
|
* @returns Parsed IR (FunctionIR or AsyncFunctionIR)
|
|
143
146
|
*/
|
|
@@ -168,6 +171,37 @@ export function loadIR(filePath) {
|
|
|
168
171
|
}
|
|
169
172
|
return ir;
|
|
170
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Loads an IR file and returns an EastIR / AsyncEastIR bundle (IR + source
|
|
176
|
+
* map). Prefer this over {@link loadIR} when the caller will compile + run
|
|
177
|
+
* the IR, so that error locations resolve end-to-end.
|
|
178
|
+
*
|
|
179
|
+
* Supports `.beast2` / `.beast` (source map read from the blob), `.json`
|
|
180
|
+
* (source map read from the `{ir, source_map}` wrapper format), and `.east`
|
|
181
|
+
* (no source map available — field stays null).
|
|
182
|
+
*/
|
|
183
|
+
export function loadEastIR(filePath) {
|
|
184
|
+
const format = getFileFormat(filePath);
|
|
185
|
+
const data = readFileSync(filePath);
|
|
186
|
+
if (format === 'beast2') {
|
|
187
|
+
// Peek at the root variant to pick sync/async decoder.
|
|
188
|
+
const probe = decodeIRFromBeast2(data);
|
|
189
|
+
if (probe.type === 'Function') {
|
|
190
|
+
return decodeEastIR(data);
|
|
191
|
+
}
|
|
192
|
+
if (probe.type === 'AsyncFunction') {
|
|
193
|
+
return decodeAsyncEastIR(data);
|
|
194
|
+
}
|
|
195
|
+
throw new Error(`IR file must contain a function or async function, got "${probe.type}"`);
|
|
196
|
+
}
|
|
197
|
+
// For east / json formats we fall back to the IR-only path (no source map).
|
|
198
|
+
// JSON wrapper parsing for {ir, source_map} can be added here if needed.
|
|
199
|
+
const ir = loadIR(filePath);
|
|
200
|
+
if (ir.type === 'Function') {
|
|
201
|
+
return new EastIR(ir);
|
|
202
|
+
}
|
|
203
|
+
return new AsyncEastIR(ir);
|
|
204
|
+
}
|
|
171
205
|
/**
|
|
172
206
|
* Loads input data from a file.
|
|
173
207
|
*
|
package/dist/loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EACH,MAAM,EACN,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../src/loader.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EACH,MAAM,EACN,eAAe,EACf,YAAY,EACZ,aAAa,EACb,aAAa,EACb,YAAY,EACZ,iBAAiB,EACjB,MAAM,EACN,WAAW,GAEd,MAAM,eAAe,CAAC;AAGvB,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAE/C,sDAAsD;AACtD,MAAM,kBAAkB,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;AAEnD,uCAAuC;AACvC,MAAM,gBAAgB,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AAE/C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C,CAAC;IAEpC,QAAQ,MAAM,EAAE,CAAC;QACb,KAAK,QAAQ,CAAC,CAAC,CAAC;YACZ,2DAA2D;YAC3D,0DAA0D;YAC1D,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;YAClC,OAAO,MAAM,CAAC,KAAK,CAAC;QACxB,CAAC;QACD,KAAK,MAAM,CAAC,CAAC,CAAC;YACV,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;YACpC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC;QACD,KAAK,MAAM,CAAC,CAAC,CAAC;YACV,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;YACpC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC;IACL,CAAC;AACL,CAAC"}
|
package/dist/runner.d.ts
CHANGED
|
@@ -5,13 +5,6 @@
|
|
|
5
5
|
import type { PlatformFunction } from '@elaraai/east/internal';
|
|
6
6
|
/**
|
|
7
7
|
* Runs an East IR program.
|
|
8
|
-
*
|
|
9
|
-
* @param irPath - Path to the IR file
|
|
10
|
-
* @param platformFns - Platform functions to use for execution
|
|
11
|
-
* @param inputPaths - Paths to input data files (order matches function parameters)
|
|
12
|
-
* @param outputPath - Optional path to write the result
|
|
13
|
-
* @param verbose - Enable verbose logging
|
|
14
|
-
* @returns The result of execution (or undefined if written to file)
|
|
15
8
|
*/
|
|
16
|
-
export declare function runProgram(irPath: string, platformFns: PlatformFunction[], inputPaths: string[], outputPath?: string, verbose?: boolean): Promise<unknown>;
|
|
9
|
+
export declare function runProgram(irPath: string, platformFns: PlatformFunction[], packages: string[], inputPaths: string[], outputPath?: string, verbose?: boolean): Promise<unknown>;
|
|
17
10
|
//# sourceMappingURL=runner.d.ts.map
|
package/dist/runner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,KAAK,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"runner.d.ts","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAWH,OAAO,KAAK,EAAE,gBAAgB,EAAiB,MAAM,wBAAwB,CAAC;AAiB9E;;GAEG;AACH,wBAAsB,UAAU,CAC5B,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,gBAAgB,EAAE,EAC/B,QAAQ,EAAE,MAAM,EAAE,EAClB,UAAU,EAAE,MAAM,EAAE,EACpB,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,GAAE,OAAe,GACzB,OAAO,CAAC,OAAO,CAAC,CA2ElB"}
|
package/dist/runner.js
CHANGED
|
@@ -2,106 +2,141 @@
|
|
|
2
2
|
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
3
|
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
4
|
*/
|
|
5
|
-
import { writeFileSync } from 'fs';
|
|
5
|
+
import { writeFileSync, statSync } from 'fs';
|
|
6
6
|
import { extname } from 'path';
|
|
7
|
-
import { EastIR,
|
|
8
|
-
import {
|
|
7
|
+
import { EastIR, encodeBeast2For, encodeEastFor, encodeJSONFor, printFor, } from '@elaraai/east';
|
|
8
|
+
import { printTypeValue } from '@elaraai/east/internal';
|
|
9
|
+
import { loadEastIR, loadInput } from './loader.js';
|
|
10
|
+
function now() { return process.hrtime.bigint(); }
|
|
11
|
+
function elapsed(start, end) { return Number(end - start) / 1e6; }
|
|
12
|
+
function formatSize(bytes) {
|
|
13
|
+
if (bytes < 1024)
|
|
14
|
+
return `${bytes} B`;
|
|
15
|
+
if (bytes < 1024 * 1024)
|
|
16
|
+
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
17
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
18
|
+
}
|
|
19
|
+
function formatFileSize(path) {
|
|
20
|
+
try {
|
|
21
|
+
return formatSize(statSync(path).size);
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return '?';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
9
27
|
/**
|
|
10
28
|
* Runs an East IR program.
|
|
11
|
-
*
|
|
12
|
-
* @param irPath - Path to the IR file
|
|
13
|
-
* @param platformFns - Platform functions to use for execution
|
|
14
|
-
* @param inputPaths - Paths to input data files (order matches function parameters)
|
|
15
|
-
* @param outputPath - Optional path to write the result
|
|
16
|
-
* @param verbose - Enable verbose logging
|
|
17
|
-
* @returns The result of execution (or undefined if written to file)
|
|
18
29
|
*/
|
|
19
|
-
export async function runProgram(irPath, platformFns, inputPaths, outputPath, verbose = false) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const ir =
|
|
25
|
-
|
|
30
|
+
export async function runProgram(irPath, platformFns, packages, inputPaths, outputPath, verbose = false) {
|
|
31
|
+
const t0 = now();
|
|
32
|
+
// Load as an EastIR bundle so source_map travels with the IR and error
|
|
33
|
+
// frames resolve end-to-end.
|
|
34
|
+
const eastIR = loadEastIR(irPath);
|
|
35
|
+
const ir = eastIR.ir;
|
|
36
|
+
const isAsync = eastIR instanceof EastIR ? false : true;
|
|
37
|
+
// Get the function's input/output types from the IR.
|
|
26
38
|
const inputTypes = ir?.value?.type?.value?.inputs ?? [];
|
|
39
|
+
const outputType = (ir?.value?.type?.value?.output ?? null);
|
|
27
40
|
// Validate input count
|
|
28
41
|
if (inputPaths.length !== inputTypes.length) {
|
|
29
42
|
throw new Error(`Function expects ${inputTypes.length} input(s), but ${inputPaths.length} input file(s) provided`);
|
|
30
43
|
}
|
|
44
|
+
// Verbose header
|
|
45
|
+
if (verbose) {
|
|
46
|
+
console.error(`Running: ${irPath} (${formatFileSize(irPath)})`);
|
|
47
|
+
if (packages.length > 0) {
|
|
48
|
+
console.error(`Platform: ${packages.length} package(s), ${platformFns.length} function(s)`);
|
|
49
|
+
for (const p of packages)
|
|
50
|
+
console.error(` - ${p}`);
|
|
51
|
+
}
|
|
52
|
+
console.error(`Function: ${inputTypes.length} inputs, ${isAsync ? 'async' : 'sync'}`);
|
|
53
|
+
for (let i = 0; i < inputTypes.length; i++) {
|
|
54
|
+
const t = printTypeValue(inputTypes[i]);
|
|
55
|
+
console.error(` input ${i}: ${inputPaths[i]} (${formatFileSize(inputPaths[i])})`);
|
|
56
|
+
console.error(` ${t}`);
|
|
57
|
+
}
|
|
58
|
+
if (outputType) {
|
|
59
|
+
console.error(` return:`);
|
|
60
|
+
console.error(` ${printTypeValue(outputType)}`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
31
63
|
// Load inputs
|
|
32
64
|
const inputs = [];
|
|
33
65
|
for (let i = 0; i < inputPaths.length; i++) {
|
|
34
|
-
|
|
35
|
-
console.error(`Loading input ${i + 1}: ${inputPaths[i]}`);
|
|
36
|
-
}
|
|
37
|
-
const input = loadInput(inputPaths[i], inputTypes[i]);
|
|
38
|
-
inputs.push(input);
|
|
66
|
+
inputs.push(loadInput(inputPaths[i], inputTypes[i]));
|
|
39
67
|
}
|
|
40
|
-
|
|
68
|
+
const t1 = now();
|
|
41
69
|
let result;
|
|
42
|
-
if (
|
|
43
|
-
if (verbose) {
|
|
44
|
-
console.error('Compiling synchronous function...');
|
|
45
|
-
}
|
|
46
|
-
const eastIR = new EastIR(ir);
|
|
70
|
+
if (!isAsync) {
|
|
47
71
|
const compiled = eastIR.compile(platformFns);
|
|
48
|
-
|
|
49
|
-
console.error('Executing...');
|
|
50
|
-
}
|
|
72
|
+
const t2 = now();
|
|
51
73
|
result = compiled(...inputs);
|
|
74
|
+
const t3 = now();
|
|
75
|
+
const t4 = maybeWriteOutput(outputPath, result, outputType, verbose);
|
|
76
|
+
const t5 = now();
|
|
77
|
+
if (verbose)
|
|
78
|
+
printTimingAndMemory(t0, t1, t2, t3, t4, t5);
|
|
52
79
|
}
|
|
53
80
|
else {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
const asyncEastIR = new AsyncEastIR(ir);
|
|
58
|
-
const compiled = asyncEastIR.compile(platformFns);
|
|
59
|
-
if (verbose) {
|
|
60
|
-
console.error('Executing...');
|
|
61
|
-
}
|
|
81
|
+
const compiled = eastIR.compile(platformFns);
|
|
82
|
+
const t2 = now();
|
|
62
83
|
result = await compiled(...inputs);
|
|
84
|
+
const t3 = now();
|
|
85
|
+
const t4 = maybeWriteOutput(outputPath, result, outputType, verbose);
|
|
86
|
+
const t5 = now();
|
|
87
|
+
if (verbose)
|
|
88
|
+
printTimingAndMemory(t0, t1, t2, t3, t4, t5);
|
|
63
89
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
90
|
+
return outputPath ? undefined : result;
|
|
91
|
+
}
|
|
92
|
+
function maybeWriteOutput(outputPath, result, outputType, verbose) {
|
|
93
|
+
if (!outputPath) {
|
|
94
|
+
// Print to stdout as .east format (matches east-c / east-py)
|
|
95
|
+
if (outputType) {
|
|
96
|
+
const printer = printFor(outputType);
|
|
97
|
+
console.log(printer(result));
|
|
68
98
|
}
|
|
69
|
-
|
|
70
|
-
const outputType = ir.type === 'Function'
|
|
71
|
-
? ir.value.output
|
|
72
|
-
: ir.value.output;
|
|
73
|
-
writeOutput(outputPath, result, outputType);
|
|
74
|
-
return undefined;
|
|
99
|
+
return now();
|
|
75
100
|
}
|
|
76
|
-
|
|
101
|
+
if (!outputType)
|
|
102
|
+
return now();
|
|
103
|
+
writeOutput(outputPath, result, outputType);
|
|
104
|
+
const t = now();
|
|
105
|
+
if (verbose) {
|
|
106
|
+
console.error(`Output: ${outputPath} (${formatFileSize(outputPath)})`);
|
|
107
|
+
console.error(` ${printTypeValue(outputType)}`);
|
|
108
|
+
}
|
|
109
|
+
return t;
|
|
110
|
+
}
|
|
111
|
+
function printTimingAndMemory(t0, t1, t2, t3, t4, t5) {
|
|
112
|
+
console.error('\nTiming:');
|
|
113
|
+
console.error(` Load: ${elapsed(t0, t1).toFixed(1).padStart(8)} ms`);
|
|
114
|
+
console.error(` Compile: ${elapsed(t1, t2).toFixed(1).padStart(8)} ms`);
|
|
115
|
+
console.error(` Execute: ${elapsed(t2, t3).toFixed(1).padStart(8)} ms`);
|
|
116
|
+
console.error(` Output: ${elapsed(t3, t4).toFixed(1).padStart(8)} ms`);
|
|
117
|
+
console.error(` Total: ${elapsed(t0, t5).toFixed(1).padStart(8)} ms`);
|
|
118
|
+
const rssBytes = process.memoryUsage().rss;
|
|
119
|
+
const rssMB = rssBytes / (1024 * 1024);
|
|
120
|
+
console.error('\nMemory:');
|
|
121
|
+
console.error(` Peak RSS: ${rssMB.toFixed(1).padStart(8)} MB`);
|
|
77
122
|
}
|
|
78
|
-
/**
|
|
79
|
-
* Writes a value to a file in the appropriate format.
|
|
80
|
-
*
|
|
81
|
-
* @param filePath - Path to write to
|
|
82
|
-
* @param value - Value to write
|
|
83
|
-
* @param type - The East type of the value
|
|
84
|
-
*/
|
|
85
123
|
function writeOutput(filePath, value, type) {
|
|
86
124
|
const ext = extname(filePath).toLowerCase();
|
|
87
125
|
switch (ext) {
|
|
88
126
|
case '.beast2':
|
|
89
127
|
case '.beast': {
|
|
90
128
|
const encoder = encodeBeast2For(type);
|
|
91
|
-
|
|
92
|
-
writeFileSync(filePath, data);
|
|
129
|
+
writeFileSync(filePath, encoder(value));
|
|
93
130
|
break;
|
|
94
131
|
}
|
|
95
132
|
case '.east': {
|
|
96
133
|
const encoder = encodeEastFor(type);
|
|
97
|
-
|
|
98
|
-
writeFileSync(filePath, data);
|
|
134
|
+
writeFileSync(filePath, encoder(value));
|
|
99
135
|
break;
|
|
100
136
|
}
|
|
101
137
|
case '.json': {
|
|
102
138
|
const encoder = encodeJSONFor(type);
|
|
103
|
-
|
|
104
|
-
writeFileSync(filePath, data);
|
|
139
|
+
writeFileSync(filePath, encoder(value));
|
|
105
140
|
break;
|
|
106
141
|
}
|
|
107
142
|
default:
|
package/dist/runner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EACH,MAAM,EACN,eAAe,EACf,aAAa,EACb,aAAa,EACb,QAAQ,GACX,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEpD,SAAS,GAAG,KAAa,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAC1D,SAAS,OAAO,CAAC,KAAa,EAAE,GAAW,IAAY,OAAO,MAAM,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAE1F,SAAS,UAAU,CAAC,KAAa;IAC7B,IAAI,KAAK,GAAG,IAAI;QAAE,OAAO,GAAG,KAAK,IAAI,CAAC;IACtC,IAAI,KAAK,GAAG,IAAI,GAAG,IAAI;QAAE,OAAO,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;IAClE,OAAO,GAAG,CAAC,KAAK,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;AACtD,CAAC;AAED,SAAS,cAAc,CAAC,IAAY;IAChC,IAAI,CAAC;QAAC,OAAO,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC;IAAC,CAAC;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AAqD,CACxD,CAAC;IACV,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025 Elara AI Pty Ltd
|
|
3
|
+
* Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
|
|
4
|
+
*/
|
|
5
|
+
export declare function writeSnapshot(params: {
|
|
6
|
+
outPath: string;
|
|
7
|
+
irPath: string;
|
|
8
|
+
inputPaths: string[];
|
|
9
|
+
packages: string[];
|
|
10
|
+
cliVersion: string;
|
|
11
|
+
}): Promise<void>;
|
|
12
|
+
export type SnapshotExtract = {
|
|
13
|
+
irPath: string;
|
|
14
|
+
inputPaths: string[];
|
|
15
|
+
packages: string[];
|
|
16
|
+
cleanup(): void;
|
|
17
|
+
};
|
|
18
|
+
export declare function readSnapshot(inPath: string): Promise<SnapshotExtract>;
|
|
19
|
+
//# sourceMappingURL=snapshot.d.ts.map
|