enyosx-ai 0.1.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 (41) hide show
  1. package/LICENSE +18 -0
  2. package/README.md +740 -0
  3. package/dist/chunk-2WM5L76D.js +320 -0
  4. package/dist/chunk-3BNDFBX3.js +324 -0
  5. package/dist/chunk-4LJILSCT.js +30 -0
  6. package/dist/chunk-4ZV5JV6W.js +298 -0
  7. package/dist/chunk-76PHNPTY.js +631 -0
  8. package/dist/chunk-BSSA33NY.js +677 -0
  9. package/dist/chunk-EK6IDRY7.js +105 -0
  10. package/dist/chunk-FI2EBH2N.js +2232 -0
  11. package/dist/chunk-GAKKLY4M.js +276 -0
  12. package/dist/chunk-HR4G5XQI.js +319 -0
  13. package/dist/chunk-HROGCEE5.js +30 -0
  14. package/dist/chunk-MMH7M7MG.js +30 -0
  15. package/dist/chunk-NGLRXS6G.js +2079 -0
  16. package/dist/chunk-NSE6LQJC.js +681 -0
  17. package/dist/chunk-O5XZOSBW.js +2484 -0
  18. package/dist/chunk-OVCMUPMP.js +677 -0
  19. package/dist/chunk-P2YBRE3X.js +2484 -0
  20. package/dist/chunk-VVIL5NIM.js +318 -0
  21. package/dist/chunk-ZNGEBY33.js +273 -0
  22. package/dist/cli.cjs +2509 -0
  23. package/dist/cli.d.ts +1 -0
  24. package/dist/cli.js +99 -0
  25. package/dist/index.cjs +2912 -0
  26. package/dist/index.d.ts +672 -0
  27. package/dist/index.js +379 -0
  28. package/dist/parser-4JXKOWKY.js +8 -0
  29. package/dist/parser-UUB6D2CZ.js +8 -0
  30. package/dist/parser-V44AIVNI.js +8 -0
  31. package/examples/README.md +13 -0
  32. package/examples/ia-demo.eny +37 -0
  33. package/examples/sample.eny +15 -0
  34. package/examples/simple/system.eny +7 -0
  35. package/examples/spec/sample.eny +19 -0
  36. package/examples/starter/README.md +96 -0
  37. package/examples/starter/main.eny +39 -0
  38. package/examples/starter/run.js +68 -0
  39. package/examples/starter.eny +16 -0
  40. package/examples/wasm-demo.eny +34 -0
  41. package/package.json +49 -0
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/cli.js ADDED
@@ -0,0 +1,99 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ runENY,
4
+ transpileToDTS,
5
+ transpileToJS,
6
+ transpileToWAT
7
+ } from "./chunk-O5XZOSBW.js";
8
+
9
+ // src/cli.ts
10
+ import fs from "fs";
11
+ import path from "path";
12
+ var argv = process.argv.slice(2);
13
+ var code = "";
14
+ var out;
15
+ var emit;
16
+ var verbose = argv.includes("--verbose");
17
+ var emitTypes = argv.includes("--emit-types");
18
+ if (argv.includes("--code")) {
19
+ const idx = argv.indexOf("--code");
20
+ code = argv[idx + 1] || "";
21
+ } else if (argv[0] && fs.existsSync(argv[0])) {
22
+ code = fs.readFileSync(path.resolve(argv[0]), "utf-8");
23
+ } else {
24
+ console.error('Usage: eny <file.eny> | eny --code "<code>" [--emit js|dts|wasm] [--emit-types] [--out out.js] [--verbose]');
25
+ process.exit(1);
26
+ }
27
+ if (argv.includes("--out")) {
28
+ const idx = argv.indexOf("--out");
29
+ out = argv[idx + 1];
30
+ }
31
+ if (argv.includes("--emit")) {
32
+ const idx = argv.indexOf("--emit");
33
+ emit = argv[idx + 1];
34
+ }
35
+ var onLog = verbose ? (entry) => {
36
+ console.log(`[${entry.timestamp}] ${entry.level.toUpperCase()} ${entry.event} ${entry.i !== void 0 ? "i=" + entry.i : ""} ${entry.line ? entry.line : ""}`);
37
+ } : void 0;
38
+ var logFile;
39
+ var logRetryAttempts;
40
+ var logRetryDelayMs;
41
+ if (argv.includes("--log-file")) {
42
+ const idx = argv.indexOf("--log-file");
43
+ logFile = argv[idx + 1];
44
+ }
45
+ if (argv.includes("--log-retry-attempts")) {
46
+ const idx = argv.indexOf("--log-retry-attempts");
47
+ logRetryAttempts = Number(argv[idx + 1]) || void 0;
48
+ }
49
+ if (argv.includes("--log-retry-delay")) {
50
+ const idx = argv.indexOf("--log-retry-delay");
51
+ logRetryDelayMs = Number(argv[idx + 1]) || void 0;
52
+ }
53
+ var ast = runENY(code, { verbose, onLog, logFile, logRetryAttempts, logRetryDelayMs });
54
+ if (logFile) {
55
+ console.log(`Logs are being appended to ${logFile}`);
56
+ if (logRetryAttempts)
57
+ console.log(`Log retry attempts: ${logRetryAttempts}`);
58
+ if (logRetryDelayMs)
59
+ console.log(`Log retry delay: ${logRetryDelayMs}ms`);
60
+ }
61
+ if (emit === "js") {
62
+ const js = transpileToJS(ast);
63
+ if (out) {
64
+ fs.writeFileSync(path.resolve(out), js, "utf-8");
65
+ console.log(`Wrote ${out}`);
66
+ if (emitTypes) {
67
+ const dts = transpileToDTS(ast);
68
+ const dtsPath = out.replace(/\.js$/, ".d.ts");
69
+ fs.writeFileSync(path.resolve(dtsPath), dts, "utf-8");
70
+ console.log(`Wrote ${dtsPath}`);
71
+ }
72
+ } else {
73
+ console.log(js);
74
+ }
75
+ process.exit(0);
76
+ }
77
+ if (emit === "dts") {
78
+ const dts = transpileToDTS(ast);
79
+ if (out) {
80
+ fs.writeFileSync(path.resolve(out), dts, "utf-8");
81
+ console.log(`Wrote ${out}`);
82
+ } else {
83
+ console.log(dts);
84
+ }
85
+ process.exit(0);
86
+ }
87
+ if (emit === "wasm" || emit === "wat") {
88
+ const wat = transpileToWAT(ast);
89
+ if (out) {
90
+ const watPath = out.endsWith(".wat") ? out : out.replace(/\.[^.]+$/, ".wat");
91
+ fs.writeFileSync(path.resolve(watPath), wat, "utf-8");
92
+ console.log(`Wrote ${watPath}`);
93
+ console.log("Note: This is a WAT stub. Use wat2wasm to compile to actual WASM.");
94
+ } else {
95
+ console.log(wat);
96
+ }
97
+ process.exit(0);
98
+ }
99
+ console.log(JSON.stringify(ast, null, 2));