@factoidal/core 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 (43) hide show
  1. package/CHANGELOG.md +121 -0
  2. package/LICENSE +201 -0
  3. package/README.md +514 -0
  4. package/browser-wasm.js +872 -0
  5. package/browser.d.ts +514 -0
  6. package/browser.js +2276 -0
  7. package/factoidal-npm-entry.js +32609 -0
  8. package/factoidal-npm-entry.wasm.assets/code-7ac046580f1bbdda8dc6.wasm +0 -0
  9. package/factoidal-npm-entry.wasm.js +455 -0
  10. package/factoidal.js +27560 -0
  11. package/factoidal.wasm.assets/code-bbe6099bfb5b10c4c3ab.wasm +0 -0
  12. package/factoidal.wasm.js +457 -0
  13. package/fn.d.ts +519 -0
  14. package/fn.js +916 -0
  15. package/hacl-init.js +92 -0
  16. package/hacl-wasm/FStar.wasm +0 -0
  17. package/hacl-wasm/Hacl_Bignum.wasm +0 -0
  18. package/hacl-wasm/Hacl_Bignum25519_51.wasm +0 -0
  19. package/hacl-wasm/Hacl_Bignum_Base.wasm +0 -0
  20. package/hacl-wasm/Hacl_Curve25519_51.wasm +0 -0
  21. package/hacl-wasm/Hacl_Ed25519.wasm +0 -0
  22. package/hacl-wasm/Hacl_Ed25519_PrecompTable.wasm +0 -0
  23. package/hacl-wasm/Hacl_Hash_Base.wasm +0 -0
  24. package/hacl-wasm/Hacl_Hash_SHA2.wasm +0 -0
  25. package/hacl-wasm/Hacl_IntTypes_Intrinsics.wasm +0 -0
  26. package/hacl-wasm/LowStar_Endianness.wasm +0 -0
  27. package/hacl-wasm/WasmSupport.wasm +0 -0
  28. package/hacl-wasm/api.js +775 -0
  29. package/hacl-wasm/api.json +3787 -0
  30. package/hacl-wasm/layouts.json +1 -0
  31. package/hacl-wasm/loader.js +568 -0
  32. package/hacl-wasm/shell.js +12 -0
  33. package/index.d.ts +1068 -0
  34. package/index.js +237 -0
  35. package/index.mjs +85 -0
  36. package/lib/api.js +2140 -0
  37. package/lib/engine-js.js +165 -0
  38. package/lib/engine-wasm.js +300 -0
  39. package/package.json +101 -0
  40. package/rdfjs.js +540 -0
  41. package/version.json +101 -0
  42. package/wasm.d.ts +130 -0
  43. package/wasm.js +158 -0
@@ -0,0 +1,165 @@
1
+ // factoidal — Node driver for the js_of_ocaml CLI bundle.
2
+ //
3
+ // The engine bundle (factoidal.js) is a single-shot CLI: argv in,
4
+ // stdout out. runCli() drives one invocation in-process:
5
+ // 1. input documents are registered in js_of_ocaml's fake filesystem
6
+ // (globalThis.jsoo_fs_tmp, drained at engine startup — `/static/`
7
+ // is always the MlFakeDevice mount, in Node and browsers alike);
8
+ // 2. globalThis.process.argv carries the flags;
9
+ // 3. stdout/stderr are captured on BOTH channels the bundle may use:
10
+ // console.log/.error (the fstar_utf8_output_stubs.js path in
11
+ // current bundles) and require('fs').writeSync on fds 1/2 (the
12
+ // classic js_of_ocaml path), the latter via a proxied require;
13
+ // 4. process.exit is replaced by a sentinel throw.
14
+ //
15
+ // This file also resolves WHICH bundle to load: an explicit override,
16
+ // then the package-local copy (what npm ships), then the repo build
17
+ // output (developer tree). The resolution is exported so tests can pin
18
+ // the freshest artifact.
19
+
20
+ 'use strict';
21
+
22
+ const fs = require('node:fs');
23
+ const path = require('node:path');
24
+
25
+ const PKG_ROOT = path.resolve(__dirname, '..');
26
+
27
+ /** Candidate bundle paths, in resolution order. */
28
+ function bundleCandidates() {
29
+ const c = [];
30
+ if (process.env.FACTOIDAL_JS_BUNDLE) c.push(process.env.FACTOIDAL_JS_BUNDLE);
31
+ c.push(path.join(PKG_ROOT, 'factoidal.js'));
32
+ // Developer tree fallback: repo build output.
33
+ c.push(path.resolve(PKG_ROOT, '..', '..', 'docs', 'fstar-extracted', 'factoidal.js'));
34
+ return c;
35
+ }
36
+
37
+ // A bundle is usable for the typed API when its CLI knows --dump-nq
38
+ // (the argv strings survive into the generated JavaScript, so a
39
+ // substring check is a reliable capability sniff). Prefer the first
40
+ // candidate that qualifies; fall back to the first that merely exists
41
+ // so queryRaw() keeps working against very old bundles.
42
+ function resolveBundlePath() {
43
+ let firstExisting = null;
44
+ for (const p of bundleCandidates()) {
45
+ if (!p || !fs.existsSync(p)) continue;
46
+ if (firstExisting === null) firstExisting = p;
47
+ try {
48
+ if (fs.readFileSync(p, 'utf8').includes('--dump-nq')) return p;
49
+ } catch (_) { /* unreadable candidate — keep looking */ }
50
+ }
51
+ if (firstExisting) return firstExisting;
52
+ throw new Error(
53
+ 'factoidal.js engine bundle not found. Run ' +
54
+ "'formal/fstar/build-ocaml.sh js && formal/fstar/build-ocaml.sh npm' " +
55
+ 'in the repo, or set FACTOIDAL_JS_BUNDLE.'
56
+ );
57
+ }
58
+
59
+ let _src = null;
60
+ let _srcPath = null;
61
+
62
+ function loadSource() {
63
+ const p = resolveBundlePath();
64
+ if (_src !== null && _srcPath === p) return _src;
65
+ _src = fs.readFileSync(p, 'utf8');
66
+ _srcPath = p;
67
+ return _src;
68
+ }
69
+
70
+ /**
71
+ * Run one CLI invocation of the js_of_ocaml engine bundle.
72
+ *
73
+ * @param {string[]} args CLI arguments (after argv[0]/argv[1]).
74
+ * @param {Array<{name: string, content: string}>} files
75
+ * Documents for the fake filesystem. Names must start
76
+ * with '/static/'.
77
+ * @returns {{stdout: string, stderr: string, exitCode: number}}
78
+ */
79
+ function runCli(args, files) {
80
+ const orig = {
81
+ argv: globalThis.process ? globalThis.process.argv : undefined,
82
+ exit: globalThis.process ? globalThis.process.exit : undefined,
83
+ jsooFs: globalThis.jsoo_fs_tmp,
84
+ consoleLog: console.log,
85
+ consoleError: console.error,
86
+ };
87
+
88
+ const stdoutChunks = [];
89
+ const stderrChunks = [];
90
+ function asUtf8(data) {
91
+ if (typeof data === 'string') return data;
92
+ if (data && typeof data.toString === 'function') {
93
+ try { return Buffer.from(data).toString('utf8'); }
94
+ catch (_) { return String(data); }
95
+ }
96
+ return String(data);
97
+ }
98
+
99
+ // js_of_ocaml's Node runtime opens fds 1/2 via require('fs') and
100
+ // writes with fs.writeSync — bypassing console.log and
101
+ // process.stdout. Proxy the fs module we hand the bundle.
102
+ const patchedFs = new Proxy(fs, {
103
+ get(target, prop, receiver) {
104
+ if (prop === 'writeSync') {
105
+ return function proxyWriteSync(fd, chunk, ...rest) {
106
+ if (fd === 1) { stdoutChunks.push(asUtf8(chunk)); return asUtf8(chunk).length; }
107
+ if (fd === 2) { stderrChunks.push(asUtf8(chunk)); return asUtf8(chunk).length; }
108
+ return target.writeSync(fd, chunk, ...rest);
109
+ };
110
+ }
111
+ return Reflect.get(target, prop, receiver);
112
+ },
113
+ });
114
+ function wrappedRequire(name) {
115
+ if (name === 'fs' || name === 'node:fs') return patchedFs;
116
+ return require(name);
117
+ }
118
+
119
+ globalThis.process = globalThis.process || {};
120
+ globalThis.process.argv = ['node', 'factoidal', ...args];
121
+ globalThis.jsoo_fs_tmp = (files || []).map((f) => ({
122
+ name: f.name,
123
+ content: f.content,
124
+ }));
125
+
126
+ // Current bundles emit stdout/stderr line-wise via console.log /
127
+ // console.error (fstar_utf8_output_stubs.js); console adds the
128
+ // trailing newline, so re-append it when capturing.
129
+ console.log = (...a) => { stdoutChunks.push(a.map(asUtf8).join(' ') + '\n'); };
130
+ console.error = (...a) => { stderrChunks.push(a.map(asUtf8).join(' ') + '\n'); };
131
+
132
+ let exitCode = 0;
133
+ const EXIT_SENTINEL = new Error('__factoidal_exit__');
134
+ globalThis.process.exit = (n) => { exitCode = n | 0; throw EXIT_SENTINEL; };
135
+
136
+ function restore() {
137
+ if (globalThis.process) {
138
+ globalThis.process.argv = orig.argv;
139
+ globalThis.process.exit = orig.exit;
140
+ }
141
+ globalThis.jsoo_fs_tmp = orig.jsooFs;
142
+ console.log = orig.consoleLog;
143
+ console.error = orig.consoleError;
144
+ }
145
+
146
+ try {
147
+ const src = loadSource();
148
+ (new Function('require', src))(wrappedRequire);
149
+ } catch (e) {
150
+ if (e !== EXIT_SENTINEL) {
151
+ restore();
152
+ throw e;
153
+ }
154
+ } finally {
155
+ restore();
156
+ }
157
+
158
+ return {
159
+ stdout: stdoutChunks.join(''),
160
+ stderr: stderrChunks.join(''),
161
+ exitCode,
162
+ };
163
+ }
164
+
165
+ module.exports = { runCli, resolveBundlePath };
@@ -0,0 +1,300 @@
1
+ // factoidal — Node driver for the wasm_of_ocaml CLI bundle.
2
+ //
3
+ // Same runCli(args, files) contract as ./engine-js.js, but backed by
4
+ // factoidal.wasm.js + factoidal.wasm.assets/*.wasm. The technique is
5
+ // the one proven by browser-wasm.js / test/smoke-wasm.mjs:
6
+ //
7
+ // - the wasm loader is an async IIFE whose Promise is discarded at
8
+ // source level; a one-marker rewrite captures it so we can await
9
+ // completion;
10
+ // - we force the loader down its Node branch (versions.node truthy)
11
+ // and hand it a fake require() whose 'node:fs' serves our
12
+ // in-memory input documents (the wasm build has no MlFakeDevice /
13
+ // jsoo_fs_tmp) and routes fds 1/2 into capture buffers;
14
+ // - 'node:fs/promises'.readFile serves the .wasm asset bytes from
15
+ // the real filesystem.
16
+ //
17
+ // Unlike engine-js.js this driver is async (wasm instantiation).
18
+
19
+ 'use strict';
20
+
21
+ const fs = require('node:fs');
22
+ const path = require('node:path');
23
+
24
+ const PKG_ROOT = path.resolve(__dirname, '..');
25
+
26
+ // The bundle's entry is an immediately-invoked async factory:
27
+ // ;(<param>=>async <arg>=>{...})(...)
28
+ // wasm_of_ocaml minifies <param> differently across versions ('$' in
29
+ // 6.x releases before mid-2026, 'ag' in 6.4.1), so match the shape,
30
+ // not a fixed name, and splice in the __fwPromise capture after the
31
+ // leading ';'.
32
+ const IIFE_RE = /;\((\$|[A-Za-z_$][\w$]*)=>async /;
33
+ const IIFE_CAPTURE = ';globalThis.__fwPromise=';
34
+
35
+ function bundleCandidates() {
36
+ const c = [];
37
+ if (process.env.FACTOIDAL_WASM_BUNDLE) c.push(process.env.FACTOIDAL_WASM_BUNDLE);
38
+ c.push(path.join(PKG_ROOT, 'factoidal.wasm.js'));
39
+ c.push(path.resolve(PKG_ROOT, '..', '..', 'docs', 'fstar-extracted', 'factoidal.wasm.js'));
40
+ return c;
41
+ }
42
+
43
+ function resolveBundlePath() {
44
+ for (const p of bundleCandidates()) {
45
+ if (p && fs.existsSync(p)) return p;
46
+ }
47
+ throw new Error(
48
+ 'factoidal.wasm.js engine bundle not found. Run ' +
49
+ "'formal/fstar/build-ocaml.sh wasm-factoidal' in the repo, or set " +
50
+ 'FACTOIDAL_WASM_BUNDLE.'
51
+ );
52
+ }
53
+
54
+ /** True if the wasm bundle (loader + .wasm asset) is present. */
55
+ function wasmAvailable() {
56
+ try {
57
+ const loader = resolveBundlePath();
58
+ const assets = path.join(path.dirname(loader), 'factoidal.wasm.assets');
59
+ return fs.existsSync(assets) &&
60
+ fs.readdirSync(assets).some((f) => f.endsWith('.wasm'));
61
+ } catch (_) {
62
+ return false;
63
+ }
64
+ }
65
+
66
+ let _src = null;
67
+ let _srcPath = null;
68
+ let _assetsDir = null;
69
+
70
+ function loadSource() {
71
+ const p = resolveBundlePath();
72
+ if (_src !== null && _srcPath === p) return _src;
73
+ const raw = fs.readFileSync(p, 'utf8');
74
+ const m = IIFE_RE.exec(raw);
75
+ if (!m) {
76
+ throw new Error(
77
+ 'engine-wasm: could not locate the async IIFE marker in ' +
78
+ 'factoidal.wasm.js — the bundle shape may have changed.'
79
+ );
80
+ }
81
+ // Keep everything, but capture the invoked IIFE's promise:
82
+ // ';(' → ';globalThis.__fwPromise=('
83
+ _src = raw.slice(0, m.index) + IIFE_CAPTURE + raw.slice(m.index + 1);
84
+ _srcPath = p;
85
+ _assetsDir = path.join(path.dirname(p), 'factoidal.wasm.assets');
86
+ return _src;
87
+ }
88
+
89
+ function makeStat(size, isFile, opts) {
90
+ const bigint = !!(opts && opts.bigint);
91
+ const toN = (v) => (bigint ? BigInt(v) : v);
92
+ return {
93
+ isFile: () => isFile,
94
+ isDirectory: () => false,
95
+ isCharacterDevice: () => !isFile,
96
+ isBlockDevice: () => false,
97
+ isSymbolicLink: () => false,
98
+ isFIFO: () => false,
99
+ isSocket: () => false,
100
+ dev: toN(0), ino: toN(0), mode: toN(0o100644),
101
+ nlink: toN(1), uid: toN(0), gid: toN(0), rdev: toN(0),
102
+ size: toN(size),
103
+ atimeMs: bigint ? 0n : 0,
104
+ mtimeMs: bigint ? 0n : 0,
105
+ ctimeMs: bigint ? 0n : 0,
106
+ };
107
+ }
108
+
109
+ /**
110
+ * Run one CLI invocation of the wasm engine bundle.
111
+ * Same contract as engine-js.runCli, but async.
112
+ *
113
+ * @param {string[]} args
114
+ * @param {Array<{name: string, content: string}>} files
115
+ * @returns {Promise<{stdout: string, stderr: string, exitCode: number}>}
116
+ */
117
+ async function runCli(args, files) {
118
+ const src = loadSource();
119
+
120
+ const TE = new TextEncoder();
121
+ const TD = new TextDecoder('utf-8');
122
+ const fileMap = new Map(
123
+ (files || []).map((f) => [f.name, TE.encode(f.content)])
124
+ );
125
+
126
+ const stdoutBuf = [];
127
+ const stderrBuf = [];
128
+
129
+ let exitCode = 0;
130
+ const EXIT_SENTINEL = new Error('__factoidal_exit__');
131
+ EXIT_SENTINEL.__factoidalExit = true;
132
+
133
+ const fakeOpenFds = Object.create(null);
134
+ let nextFd = 100;
135
+
136
+ function writeSync(fd, buf, offset, length /*, position */) {
137
+ let s;
138
+ if (typeof buf === 'string') {
139
+ s = buf;
140
+ } else {
141
+ const u8 = buf instanceof Uint8Array
142
+ ? buf
143
+ : new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);
144
+ const start = offset || 0;
145
+ const end = start + (length === undefined ? u8.length - start : length);
146
+ s = TD.decode(u8.subarray(start, end));
147
+ }
148
+ (fd === 2 ? stderrBuf : stdoutBuf).push(s);
149
+ return length === undefined ? s.length : length;
150
+ }
151
+
152
+ const fileForPath = (p) => fileMap.get(String(p)) || null;
153
+
154
+ const fakeFs = {
155
+ constants: {
156
+ R_OK: 4, W_OK: 2, X_OK: 1, F_OK: 0,
157
+ O_RDONLY: 0, O_WRONLY: 1, O_RDWR: 2, O_APPEND: 8, O_CREAT: 512,
158
+ O_TRUNC: 1024, O_EXCL: 2048, O_NONBLOCK: 4096, O_NOCTTY: 8192,
159
+ O_DSYNC: 4194304, O_SYNC: 128,
160
+ },
161
+ writeSync,
162
+ openSync: (p /*, flags, mode */) => {
163
+ const f = fileForPath(p);
164
+ if (!f) {
165
+ throw Object.assign(
166
+ new Error(`ENOENT: no such file or directory, open '${p}'`),
167
+ { code: 'ENOENT', errno: -2, syscall: 'open', path: p });
168
+ }
169
+ const fd = nextFd++;
170
+ fakeOpenFds[fd] = { path: String(p), buf: f, offset: 0 };
171
+ return fd;
172
+ },
173
+ closeSync: (fd) => { delete fakeOpenFds[fd]; },
174
+ readSync: (fd, buf, offset, length, position) => {
175
+ const f = fakeOpenFds[fd];
176
+ if (!f) throw Object.assign(new Error('EBADF'), { code: 'EBADF', errno: -9 });
177
+ const pos = (position === null || position === undefined)
178
+ ? f.offset : Number(position);
179
+ const remaining = Math.max(0, f.buf.length - pos);
180
+ const n = Math.min(length, remaining);
181
+ for (let i = 0; i < n; i++) buf[offset + i] = f.buf[pos + i];
182
+ if (position === null || position === undefined) f.offset = pos + n;
183
+ return n;
184
+ },
185
+ fsyncSync: () => {},
186
+ existsSync: (p) => fileForPath(p) !== null,
187
+ accessSync: (p) => {
188
+ if (!fileForPath(p)) {
189
+ throw Object.assign(new Error('ENOENT'), { code: 'ENOENT', errno: -2 });
190
+ }
191
+ },
192
+ statSync: (p, o) => {
193
+ const f = fileForPath(p);
194
+ if (!f) {
195
+ if (o && o.throwIfNoEntry === false) return undefined;
196
+ throw Object.assign(new Error('ENOENT'), { code: 'ENOENT', errno: -2 });
197
+ }
198
+ return makeStat(f.length, true, o);
199
+ },
200
+ lstatSync: (p, o) => fakeFs.statSync(p, o),
201
+ fstatSync: (fd, o) => {
202
+ const f = fakeOpenFds[fd];
203
+ return makeStat(f ? f.buf.length : 0, !!f, o);
204
+ },
205
+ };
206
+
207
+ // Serve the .wasm asset from the real filesystem next to the loader.
208
+ async function readWasmAsset(requestedPath) {
209
+ const s = String(requestedPath);
210
+ const marker = 'factoidal.wasm.assets/';
211
+ const ix = s.lastIndexOf(marker);
212
+ const sub = ix < 0 ? s : s.slice(ix + marker.length);
213
+ const abs = path.join(_assetsDir, path.basename(sub));
214
+ return fs.readFileSync(abs);
215
+ }
216
+
217
+ const fakeRequire = (name) => {
218
+ if (name === 'node:fs') return fakeFs;
219
+ if (name === 'node:fs/promises') return { readFile: readWasmAsset };
220
+ if (name === 'node:path') return {
221
+ join: (...parts) => parts.filter(Boolean).join('/').replace(/\/+/g, '/'),
222
+ dirname: (p) => String(p).replace(/\/[^/]*$/, '') || '.',
223
+ };
224
+ if (name === 'node:os') return { tmpdir: () => '/tmp' };
225
+ if (name === 'node:tty') return { isatty: () => false };
226
+ if (name === 'node:child_process') return { spawnSync: () => ({ status: 0, signal: null }) };
227
+ throw new Error(`engine-wasm shim: unexpected require('${name}')`);
228
+ };
229
+ fakeRequire.main = { filename: '/factoidal/main.js' };
230
+
231
+ const fakeProc = {
232
+ argv: ['node', 'factoidal', ...args],
233
+ exit: (n) => { exitCode = n | 0; throw EXIT_SENTINEL; },
234
+ stdout: { write: (s) => stdoutBuf.push(String(s)) },
235
+ stderr: { write: (s) => stderrBuf.push(String(s)) },
236
+ platform: 'linux',
237
+ versions: { node: process.versions.node || '22.0.0' },
238
+ env: {},
239
+ cpuUsage: () => ({ user: 0, system: 0 }),
240
+ on: () => {},
241
+ cwd: () => '/static',
242
+ chdir: () => {},
243
+ };
244
+
245
+ const orig = {
246
+ proc: globalThis.process,
247
+ jsooFs: globalThis.jsoo_fs_tmp,
248
+ require: globalThis.require,
249
+ fwPromise: globalThis.__fwPromise,
250
+ consoleLog: console.log,
251
+ consoleError: console.error,
252
+ };
253
+
254
+ globalThis.process = fakeProc;
255
+ globalThis.require = fakeRequire;
256
+ globalThis.jsoo_fs_tmp = undefined;
257
+ delete globalThis.__fwPromise;
258
+ // Belt and braces: some bundle variants route output through
259
+ // console.log/.error (line-wise, newline re-appended on capture).
260
+ console.log = (...a) => { stdoutBuf.push(a.map(String).join(' ') + '\n'); };
261
+ console.error = (...a) => { stderrBuf.push(a.map(String).join(' ') + '\n'); };
262
+
263
+ function restoreGlobals() {
264
+ globalThis.process = orig.proc;
265
+ globalThis.jsoo_fs_tmp = orig.jsooFs;
266
+ if (orig.require === undefined) delete globalThis.require;
267
+ else globalThis.require = orig.require;
268
+ if (orig.fwPromise === undefined) delete globalThis.__fwPromise;
269
+ else globalThis.__fwPromise = orig.fwPromise;
270
+ console.log = orig.consoleLog;
271
+ console.error = orig.consoleError;
272
+ }
273
+
274
+ try {
275
+ (new Function(src))();
276
+ const p = globalThis.__fwPromise;
277
+ if (!p || typeof p.then !== 'function') {
278
+ throw new Error(
279
+ 'engine-wasm: __fwPromise was not captured — the bundle shape ' +
280
+ 'may have changed.');
281
+ }
282
+ try {
283
+ await p;
284
+ } catch (e) {
285
+ // process.exit throws the sentinel through the async IIFE; that
286
+ // is the normal completion path.
287
+ if (e !== EXIT_SENTINEL && !(e && e.__factoidalExit)) throw e;
288
+ }
289
+ } finally {
290
+ restoreGlobals();
291
+ }
292
+
293
+ return {
294
+ stdout: stdoutBuf.join(''),
295
+ stderr: stderrBuf.join(''),
296
+ exitCode,
297
+ };
298
+ }
299
+
300
+ module.exports = { runCli, resolveBundlePath, wasmAvailable };
package/package.json ADDED
@@ -0,0 +1,101 @@
1
+ {
2
+ "name": "@factoidal/core",
3
+ "version": "0.1.0",
4
+ "description": "Formally verified RDF/SPARQL engine, extracted from F* specifications, for Node and the browser (JS + Wasm). Parser and algebra spec verified in F*; on-disk backend has unverified OCaml-side optimization layers being migrated back to F*.",
5
+ "keywords": [
6
+ "sparql",
7
+ "rdf",
8
+ "turtle",
9
+ "ntriples",
10
+ "nquads",
11
+ "trig",
12
+ "rdf-xml",
13
+ "fstar",
14
+ "formal-verification",
15
+ "semantic-web"
16
+ ],
17
+ "homepage": "https://github.com/danbri/factoidal",
18
+ "bugs": {
19
+ "url": "https://github.com/danbri/factoidal/issues"
20
+ },
21
+ "license": "Apache-2.0",
22
+ "author": "Dan Brickley <danbri@danbri.org>",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/danbri/factoidal.git",
26
+ "directory": "npm/factoidal"
27
+ },
28
+ "main": "./index.js",
29
+ "module": "./index.mjs",
30
+ "browser": "./browser.js",
31
+ "types": "./index.d.ts",
32
+ "exports": {
33
+ ".": {
34
+ "types": "./index.d.ts",
35
+ "browser": "./browser.js",
36
+ "import": "./index.mjs",
37
+ "require": "./index.js",
38
+ "default": "./index.js"
39
+ },
40
+ "./wasm": {
41
+ "types": "./wasm.d.ts",
42
+ "default": "./wasm.js"
43
+ },
44
+ "./rdfjs": "./rdfjs.js",
45
+ "./fn": {
46
+ "types": "./fn.d.ts",
47
+ "default": "./fn.js"
48
+ },
49
+ "./browser": {
50
+ "types": "./browser.d.ts",
51
+ "default": "./browser.js"
52
+ },
53
+ "./browser-wasm": {
54
+ "browser": "./browser-wasm.js",
55
+ "default": "./browser-wasm.js"
56
+ },
57
+ "./factoidal.js": "./factoidal.js",
58
+ "./factoidal.wasm.js": "./factoidal.wasm.js",
59
+ "./factoidal.wasm.assets/*": "./factoidal.wasm.assets/*",
60
+ "./package.json": "./package.json"
61
+ },
62
+ "files": [
63
+ "index.js",
64
+ "index.mjs",
65
+ "index.d.ts",
66
+ "wasm.js",
67
+ "wasm.d.ts",
68
+ "rdfjs.js",
69
+ "fn.js",
70
+ "fn.d.ts",
71
+ "lib/",
72
+ "browser.js",
73
+ "browser.d.ts",
74
+ "browser-wasm.js",
75
+ "factoidal.js",
76
+ "factoidal.wasm.js",
77
+ "factoidal.wasm.assets/",
78
+ "factoidal-npm-entry.js",
79
+ "factoidal-npm-entry.wasm.js",
80
+ "factoidal-npm-entry.wasm.assets/",
81
+ "hacl-init.js",
82
+ "hacl-wasm/",
83
+ "version.json",
84
+ "README.md",
85
+ "CHANGELOG.md",
86
+ "LICENSE"
87
+ ],
88
+ "engines": {
89
+ "node": ">=20"
90
+ },
91
+ "sideEffects": false,
92
+ "scripts": {
93
+ "build": "cd ../../formal/fstar && ./build-ocaml.sh npm",
94
+ "test": "node --test 'test/*.test.js'",
95
+ "test:smoke": "node test/smoke.js && node test/smoke-wasm.mjs",
96
+ "prepublishOnly": "npm test"
97
+ },
98
+ "publishConfig": {
99
+ "access": "public"
100
+ }
101
+ }