novac 2.2.0 → 2.2.2

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 (122) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/bin/novac +6 -3
  4. package/bin/nvc +0 -0
  5. package/bin/nvml +0 -0
  6. package/demo.nv +0 -0
  7. package/demo_builtins.nv +0 -0
  8. package/demo_http.nv +0 -0
  9. package/examples/bf.nv +5 -13
  10. package/examples/math.nv +2 -2
  11. package/kits/kitffmpeg/kitdef.js +1174 -0
  12. package/kits/libos/kitdef.js +3135 -0
  13. package/kits/libtasker/kitdef.js +125 -0
  14. package/package.json +1 -1
  15. package/scripts/update-bin.js +0 -0
  16. package/src/core/executor.js +7 -4
  17. package/src/core/lexer.js +2 -2
  18. package/src/index.js +0 -0
  19. package/novac/LICENSE +0 -21
  20. package/novac/README.md +0 -1823
  21. package/novac/bin/novac +0 -950
  22. package/novac/bin/nvc +0 -522
  23. package/novac/bin/nvml +0 -542
  24. package/novac/demo.nv +0 -245
  25. package/novac/demo_builtins.nv +0 -209
  26. package/novac/demo_http.nv +0 -62
  27. package/novac/examples/bf.nv +0 -69
  28. package/novac/examples/math.nv +0 -21
  29. package/novac/kits/kitai/kitdef.js +0 -2185
  30. package/novac/kits/kitansi/kitdef.js +0 -1402
  31. package/novac/kits/kitformat/kitdef.js +0 -1485
  32. package/novac/kits/kitgps/kitdef.js +0 -1862
  33. package/novac/kits/kitlibfs/kitdef.js +0 -231
  34. package/novac/kits/kitlibproc/kitdef.js +0 -78
  35. package/novac/kits/kitmatrix/ex.js +0 -19
  36. package/novac/kits/kitmatrix/kitdef.js +0 -960
  37. package/novac/kits/kitmpatch/kitdef.js +0 -906
  38. package/novac/kits/kitnovacweb/README.md +0 -1572
  39. package/novac/kits/kitnovacweb/demo.nv +0 -12
  40. package/novac/kits/kitnovacweb/demo.nvml +0 -71
  41. package/novac/kits/kitnovacweb/index.nova +0 -12
  42. package/novac/kits/kitnovacweb/kitdef.js +0 -692
  43. package/novac/kits/kitnovacweb/nova.kit.json +0 -8
  44. package/novac/kits/kitnovacweb/nvml/executor.js +0 -739
  45. package/novac/kits/kitnovacweb/nvml/index.js +0 -67
  46. package/novac/kits/kitnovacweb/nvml/lexer.js +0 -263
  47. package/novac/kits/kitnovacweb/nvml/parser.js +0 -508
  48. package/novac/kits/kitnovacweb/nvml/renderer.js +0 -924
  49. package/novac/kits/kitparse/kitdef.js +0 -1688
  50. package/novac/kits/kitregex++/kitdef.js +0 -1353
  51. package/novac/kits/kitrequire/kitdef.js +0 -1599
  52. package/novac/kits/kitx11/kitdef.js +0 -1
  53. package/novac/kits/kitx11/kitx11.js +0 -2472
  54. package/novac/kits/kitx11/kitx11_conn.js +0 -948
  55. package/novac/kits/kitx11/kitx11_worker.js +0 -121
  56. package/novac/kits/libtea/tf.js +0 -2691
  57. package/novac/kits/libterm/ex.js +0 -285
  58. package/novac/kits/libterm/kitdef.js +0 -1927
  59. package/novac/node_modules/chalk/license +0 -9
  60. package/novac/node_modules/chalk/package.json +0 -83
  61. package/novac/node_modules/chalk/readme.md +0 -297
  62. package/novac/node_modules/chalk/source/index.d.ts +0 -325
  63. package/novac/node_modules/chalk/source/index.js +0 -225
  64. package/novac/node_modules/chalk/source/utilities.js +0 -33
  65. package/novac/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +0 -236
  66. package/novac/node_modules/chalk/source/vendor/ansi-styles/index.js +0 -223
  67. package/novac/node_modules/chalk/source/vendor/supports-color/browser.d.ts +0 -1
  68. package/novac/node_modules/chalk/source/vendor/supports-color/browser.js +0 -34
  69. package/novac/node_modules/chalk/source/vendor/supports-color/index.d.ts +0 -55
  70. package/novac/node_modules/chalk/source/vendor/supports-color/index.js +0 -190
  71. package/novac/node_modules/commander/LICENSE +0 -22
  72. package/novac/node_modules/commander/Readme.md +0 -1176
  73. package/novac/node_modules/commander/esm.mjs +0 -16
  74. package/novac/node_modules/commander/index.js +0 -24
  75. package/novac/node_modules/commander/lib/argument.js +0 -150
  76. package/novac/node_modules/commander/lib/command.js +0 -2777
  77. package/novac/node_modules/commander/lib/error.js +0 -39
  78. package/novac/node_modules/commander/lib/help.js +0 -747
  79. package/novac/node_modules/commander/lib/option.js +0 -380
  80. package/novac/node_modules/commander/lib/suggestSimilar.js +0 -101
  81. package/novac/node_modules/commander/package-support.json +0 -19
  82. package/novac/node_modules/commander/package.json +0 -82
  83. package/novac/node_modules/commander/typings/esm.d.mts +0 -3
  84. package/novac/node_modules/commander/typings/index.d.ts +0 -1113
  85. package/novac/node_modules/node-addon-api/LICENSE.md +0 -9
  86. package/novac/node_modules/node-addon-api/README.md +0 -95
  87. package/novac/node_modules/node-addon-api/common.gypi +0 -21
  88. package/novac/node_modules/node-addon-api/except.gypi +0 -25
  89. package/novac/node_modules/node-addon-api/index.js +0 -14
  90. package/novac/node_modules/node-addon-api/napi-inl.deprecated.h +0 -186
  91. package/novac/node_modules/node-addon-api/napi-inl.h +0 -7165
  92. package/novac/node_modules/node-addon-api/napi.h +0 -3364
  93. package/novac/node_modules/node-addon-api/node_addon_api.gyp +0 -42
  94. package/novac/node_modules/node-addon-api/node_api.gyp +0 -9
  95. package/novac/node_modules/node-addon-api/noexcept.gypi +0 -26
  96. package/novac/node_modules/node-addon-api/nothing.c +0 -0
  97. package/novac/node_modules/node-addon-api/package-support.json +0 -21
  98. package/novac/node_modules/node-addon-api/package.json +0 -480
  99. package/novac/node_modules/node-addon-api/tools/README.md +0 -73
  100. package/novac/node_modules/node-addon-api/tools/check-napi.js +0 -99
  101. package/novac/node_modules/node-addon-api/tools/clang-format.js +0 -71
  102. package/novac/node_modules/node-addon-api/tools/conversion.js +0 -301
  103. package/novac/node_modules/serialize-javascript/LICENSE +0 -27
  104. package/novac/node_modules/serialize-javascript/README.md +0 -149
  105. package/novac/node_modules/serialize-javascript/index.js +0 -297
  106. package/novac/node_modules/serialize-javascript/package.json +0 -33
  107. package/novac/package.json +0 -27
  108. package/novac/scripts/update-bin.js +0 -24
  109. package/novac/src/core/bstd.js +0 -1035
  110. package/novac/src/core/config.js +0 -155
  111. package/novac/src/core/describe.js +0 -187
  112. package/novac/src/core/emitter.js +0 -499
  113. package/novac/src/core/error.js +0 -86
  114. package/novac/src/core/executor.js +0 -5606
  115. package/novac/src/core/formatter.js +0 -686
  116. package/novac/src/core/lexer.js +0 -1026
  117. package/novac/src/core/nova_builtins.js +0 -717
  118. package/novac/src/core/nova_thread_worker.js +0 -166
  119. package/novac/src/core/parser.js +0 -2181
  120. package/novac/src/core/types.js +0 -112
  121. package/novac/src/index.js +0 -28
  122. package/novac/src/runtime/stdlib.js +0 -244
@@ -1,231 +0,0 @@
1
- const { kStringMaxLength } = require('buffer');
2
- const fs = require('fs');
3
- const path = require('path');
4
-
5
- const filesystem = {
6
- //note:this implementation is completely synchronous, It is only intended for use in development and testing environments.
7
- //it should have all fs methods, but synchronous versions only.
8
- read: (filePath, encoding = 'utf8') => {
9
- const absolutePath = path.resolve(filePath);
10
- if (!fs.existsSync(absolutePath)) {
11
- throw new Error(`File not found: ${filePath}`);
12
- }
13
- return fs.readFileSync(absolutePath, encoding);
14
- },
15
- write: (filePath, content, encoding = 'utf8') => {
16
- const absolutePath = path.resolve(filePath);
17
- fs.writeFileSync(absolutePath, content, encoding);
18
- },
19
- exists: (filePath) => {
20
- const absolutePath = path.resolve(filePath);
21
- return fs.existsSync(absolutePath);
22
- },
23
- delete: (filePath) => {
24
- const absolutePath = path.resolve(filePath);
25
- if (fs.existsSync(absolutePath)) {
26
- fs.unlinkSync(absolutePath);
27
- }
28
- },
29
- list: (directoryPath) => {
30
- const absolutePath = path.resolve(directoryPath);
31
- return fs.readdirSync(absolutePath);
32
- },
33
- isDirectory: (filePath) => {
34
- const absolutePath = path.resolve(filePath);
35
- return fs.statSync(absolutePath).isDirectory();
36
- },
37
- createDirectory: (directoryPath) => {
38
- const absolutePath = path.resolve(directoryPath);
39
- fs.mkdirSync(absolutePath);
40
- },
41
- deleteDirectory: (directoryPath) => {
42
- const absolutePath = path.resolve(directoryPath);
43
- if (fs.existsSync(absolutePath)) {
44
- fs.rmdirSync(absolutePath);
45
- }
46
- },
47
- stats: (filePath) => {
48
- const absolutePath = path.resolve(filePath);
49
- return fs.statSync(absolutePath);
50
- },
51
- cp: (sourcePath, destinationPath) => {
52
- const absoluteSourcePath = path.resolve(sourcePath);
53
- const absoluteDestinationPath = path.resolve(destinationPath);
54
- fs.copyFileSync(absoluteSourcePath, absoluteDestinationPath);
55
- },
56
- cpDir: (sourceDir, destinationDir) => {
57
- const absoluteSourceDir = path.resolve(sourceDir);
58
- const absoluteDestinationDir = path.resolve(destinationDir);
59
- if (!fs.existsSync(absoluteDestinationDir)) {
60
- fs.mkdirSync(absoluteDestinationDir);
61
- }
62
- const items = fs.readdirSync(absoluteSourceDir);
63
- items.forEach(item => {
64
- const sourceItemPath = path.join(absoluteSourceDir, item);
65
- const destinationItemPath = path.join(absoluteDestinationDir, item);
66
- if (fs.statSync(sourceItemPath).isDirectory()) {
67
- filesystem.cpDir(sourceItemPath, destinationItemPath);
68
- } else {
69
- fs.copyFileSync(sourceItemPath, destinationItemPath);
70
- }
71
- });
72
- },
73
- appendFile: (filePath, content, encoding = 'utf8') => {
74
- const absolutePath = path.resolve(filePath);
75
- fs.appendFileSync(absolutePath, content, encoding);
76
- },
77
- rename: (oldPath, newPath) => {
78
- const absoluteOldPath = path.resolve(oldPath);
79
- const absoluteNewPath = path.resolve(newPath);
80
- fs.renameSync(absoluteOldPath, absoluteNewPath);
81
- },
82
- access: (filePath, mode = fs.constants.F_OK) => {
83
- const absolutePath = path.resolve(filePath);
84
- try {
85
- fs.accessSync(absolutePath, mode);
86
- return true;
87
- } catch {
88
- return false;
89
- }
90
- },
91
- chmod: (filePath, mode) => {
92
- const absolutePath = path.resolve(filePath);
93
- fs.chmodSync(absolutePath, mode);
94
- },
95
- readlink: (filePath) => {
96
- const absolutePath = path.resolve(filePath);
97
- return fs.readlinkSync(absolutePath);
98
- },
99
- symlink: (target, filePath, type = 'file') => {
100
- const absoluteTarget = path.resolve(target);
101
- const absolutePath = path.resolve(filePath);
102
- fs.symlinkSync(absoluteTarget, absolutePath, type);
103
- },
104
- link: (existingPath, newPath) => {
105
- const absoluteExistingPath = path.resolve(existingPath);
106
- const absoluteNewPath = path.resolve(newPath);
107
- fs.linkSync(absoluteExistingPath, absoluteNewPath);
108
- },
109
- lstat: (filePath) => {
110
- const absolutePath = path.resolve(filePath);
111
- return fs.lstatSync(absolutePath);
112
- },
113
- realpath: (filePath) => {
114
- const absolutePath = path.resolve(filePath);
115
- return fs.realpathSync(absolutePath);
116
- },
117
- isFile: (filePath) => {
118
- const absolutePath = path.resolve(filePath);
119
- if (!fs.existsSync(absolutePath)) return false;
120
- return fs.statSync(absolutePath).isFile();
121
- },
122
- isSymbolicLink: (filePath) => {
123
- const absolutePath = path.resolve(filePath);
124
- if (!fs.existsSync(absolutePath)) return false;
125
- return fs.lstatSync(absolutePath).isSymbolicLink();
126
- },
127
- truncate: (filePath, len = 0) => {
128
- const absolutePath = path.resolve(filePath);
129
- fs.truncateSync(absolutePath, len);
130
- },
131
- mkdtemp: (prefix) => {
132
- return fs.mkdtempSync(prefix);
133
- },
134
- rm: (filePath, options = {}) => {
135
- const absolutePath = path.resolve(filePath);
136
- if (fs.existsSync(absolutePath)) {
137
- const stat = fs.statSync(absolutePath);
138
- if (stat.isDirectory()) {
139
- if (options.recursive) {
140
- fs.rmSync(absolutePath, { recursive: true });
141
- } else {
142
- fs.rmdirSync(absolutePath);
143
- }
144
- } else {
145
- fs.unlinkSync(absolutePath);
146
- }
147
- }
148
- },
149
- dirents: (directoryPath) => {
150
- const absolutePath = path.resolve(directoryPath);
151
- return fs.readdirSync(absolutePath, { withFileTypes: true });
152
- },
153
- // Path utilities
154
- pathDirname: (filePath) => {
155
- return path.dirname(filePath);
156
- },
157
- pathBasename: (filePath, ext = '') => {
158
- return path.basename(filePath, ext);
159
- },
160
- pathExtname: (filePath) => {
161
- return path.extname(filePath);
162
- },
163
- pathJoin: (...paths) => {
164
- return path.join(...paths);
165
- },
166
- pathResolve: (...paths) => {
167
- return path.resolve(...paths);
168
- },
169
- pathRelative: (from, to) => {
170
- return path.relative(from, to);
171
- },
172
- pathNormalize: (filePath) => {
173
- return path.normalize(filePath);
174
- },
175
- pathParse: (filePath) => {
176
- return path.parse(filePath);
177
- },
178
- pathFormat: (pathObj) => {
179
- return path.format(pathObj);
180
- },
181
- pathIsAbsolute: (filePath) => {
182
- return path.isAbsolute(filePath);
183
- },
184
- getSize: (filePath) => {
185
- const absolutePath = path.resolve(filePath);
186
- return fs.statSync(absolutePath).size;
187
- },
188
- isReadable: (filePath) => {
189
- const absolutePath = path.resolve(filePath);
190
- try {
191
- fs.accessSync(absolutePath, fs.constants.R_OK);
192
- return true;
193
- } catch {
194
- return false;
195
- }
196
- },
197
- isWritable: (filePath) => {
198
- const absolutePath = path.resolve(filePath);
199
- try {
200
- fs.accessSync(absolutePath, fs.constants.W_OK);
201
- return true;
202
- } catch {
203
- return false;
204
- }
205
- },
206
- isExecutable: (filePath) => {
207
- const absolutePath = path.resolve(filePath);
208
- try {
209
- fs.accessSync(absolutePath, fs.constants.X_OK);
210
- return true;
211
- } catch {
212
- return false;
213
- }
214
- },
215
- getModifiedTime: (filePath) => {
216
- const absolutePath = path.resolve(filePath);
217
- return fs.statSync(absolutePath).mtime;
218
- },
219
- getCreatedTime: (filePath) => {
220
- const absolutePath = path.resolve(filePath);
221
- return fs.statSync(absolutePath).birthtime;
222
- },
223
- getAccessedTime: (filePath) => {
224
- const absolutePath = path.resolve(filePath);
225
- return fs.statSync(absolutePath).atime;
226
- },
227
- };
228
-
229
- module.exports = {
230
- kitdef: filesystem
231
- };
@@ -1,78 +0,0 @@
1
- // kitlibproc — process & shell execution kit for Nova
2
- // Synchronous wrappers around child_process for scripting use.
3
- const { execSync, spawnSync } = require('child_process');
4
- const os = require('os');
5
- const path = require('path');
6
- const fs = require('fs');
7
-
8
- const proc = {
9
- // Run a shell command, return stdout string. Throws on non-zero exit.
10
- exec(cmd, options = {}) {
11
- const { cwd = process.cwd(), env = process.env, timeout = 30000 } = options;
12
- return execSync(cmd, { encoding: 'utf8', cwd, env, timeout }).trimEnd();
13
- },
14
-
15
- // Run a command, return { code, stdout, stderr } — never throws.
16
- run(cmd, options = {}) {
17
- const { cwd = process.cwd(), env = process.env, timeout = 30000 } = options;
18
- try {
19
- const stdout = execSync(cmd, { encoding: 'utf8', cwd, env, timeout, stdio: ['ignore', 'pipe', 'pipe'] }).trimEnd();
20
- return { code: 0, stdout, stderr: '' };
21
- } catch (e) {
22
- return { code: e.status || 1, stdout: (e.stdout || '').trimEnd(), stderr: (e.stderr || '').trimEnd() };
23
- }
24
- },
25
-
26
- // Spawn a process with explicit argv, return { code, stdout, stderr }
27
- spawn(bin, args = [], options = {}) {
28
- const { cwd = process.cwd(), env = process.env, timeout = 30000 } = options;
29
- const result = spawnSync(bin, args, { encoding: 'utf8', cwd, env, timeout });
30
- return {
31
- code: result.status ?? 1,
32
- stdout: (result.stdout || '').trimEnd(),
33
- stderr: (result.stderr || '').trimEnd(),
34
- };
35
- },
36
-
37
- // Exit current process
38
- exit(code = 0) { process.exit(code); },
39
-
40
- // Environment variable access
41
- env(key) { return process.env[key] ?? null; },
42
- setEnv(key, value) { process.env[key] = String(value); },
43
-
44
- // Current working directory
45
- cwd() { return process.cwd(); },
46
- chdir(dir) { process.chdir(dir); },
47
-
48
- // Platform info
49
- platform() { return os.platform(); },
50
- arch() { return os.arch(); },
51
- hostname() { return os.hostname(); },
52
- cpus() { return os.cpus().length; },
53
- mem() { return { total: os.totalmem(), free: os.freemem() }; },
54
-
55
- // Temp file helpers
56
- tmpFile(ext = '.tmp') {
57
- return path.join(os.tmpdir(), `nv_tmp_${Date.now()}${ext}`);
58
- },
59
- tmpDir() {
60
- const d = fs.mkdtempSync(path.join(os.tmpdir(), 'nova_'));
61
- return d;
62
- },
63
-
64
- // Sleep (blocking) in ms
65
- sleepSync(ms) {
66
- const t = Date.now() + ms;
67
- while (Date.now() < t) { /* spin */ }
68
- },
69
-
70
- // PID of current process
71
- pid() { return process.pid; },
72
-
73
- // argv passthrough
74
- argv() { return process.argv.slice(2); },
75
- ...process
76
- };
77
-
78
- module.exports = { kitdef: proc };
@@ -1,19 +0,0 @@
1
- const { Matrix } = require("./kitdef").kitdef;
2
-
3
- const m = new Matrix(20, 20);
4
-
5
- const grid = m.grid(10, 10, 0, 0, 2, 2);
6
-
7
- const player = grid.at(2, 2)
8
- .clone()
9
- .withLabel("@");
10
-
11
- const target = grid.at(8, 7)
12
- .clone()
13
- .withLabel("X");
14
-
15
- console.log(player.distanceTo(target));
16
-
17
- const neighbors = grid.neighbors(2, 2, true);
18
-
19
- m.render.frame()