@trylimbo/sdk-module-mxf 0.0.0-stage → 0.3.0-canary.41
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/gen/ffi/index.d.ts +3 -0
- package/gen/ffi/index.js +30 -0
- package/package.json +41 -3
- package/README.md +0 -3
package/gen/ffi/index.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
//#region ../../../../../scripts/catalog/native-runtime.ts
|
|
3
|
+
/** Resolve a supported native target without loading a host binding or native library. */
|
|
4
|
+
function nativeTriple(supported) {
|
|
5
|
+
const os = process.platform;
|
|
6
|
+
const cpu = process.arch;
|
|
7
|
+
let environment = "";
|
|
8
|
+
if (os === "linux") {
|
|
9
|
+
const report = process.report?.getReport();
|
|
10
|
+
if (typeof report !== "object" || report === null || !("header" in report) || typeof report.header !== "object" || report.header === null) throw new Error("cannot identify the Linux C library: process.report is unavailable");
|
|
11
|
+
environment = "glibcVersionRuntime" in report.header && typeof report.header.glibcVersionRuntime === "string" ? "-gnu" : "-musl";
|
|
12
|
+
}
|
|
13
|
+
const name = `${os}-${cpu}${environment}`;
|
|
14
|
+
const found = supported.find((target) => target === name);
|
|
15
|
+
if (found === void 0) throw new Error(`${name} is not a supported native target`);
|
|
16
|
+
return found;
|
|
17
|
+
}
|
|
18
|
+
const mxf = createRequire(import.meta.url).resolve({
|
|
19
|
+
"darwin-arm64": "@trylimbo/sdk-module-mxf-darwin-arm64/libtrylimbo_module_mxf.dylib",
|
|
20
|
+
"darwin-x64": "@trylimbo/sdk-module-mxf-darwin-x64/libtrylimbo_module_mxf.dylib",
|
|
21
|
+
"linux-arm64-gnu": "@trylimbo/sdk-module-mxf-linux-arm64-gnu/libtrylimbo_module_mxf.so",
|
|
22
|
+
"linux-x64-gnu": "@trylimbo/sdk-module-mxf-linux-x64-gnu/libtrylimbo_module_mxf.so"
|
|
23
|
+
}[nativeTriple([
|
|
24
|
+
"darwin-arm64",
|
|
25
|
+
"darwin-x64",
|
|
26
|
+
"linux-arm64-gnu",
|
|
27
|
+
"linux-x64-gnu"
|
|
28
|
+
])]);
|
|
29
|
+
//#endregion
|
|
30
|
+
export { mxf };
|
package/package.json
CHANGED
|
@@ -1,6 +1,44 @@
|
|
|
1
1
|
{
|
|
2
|
+
"optionalDependencies": {
|
|
3
|
+
"@trylimbo/sdk-module-mxf-linux-arm64-gnu": "0.3.0-canary.41",
|
|
4
|
+
"@trylimbo/sdk-module-mxf-linux-x64-gnu": "0.3.0-canary.41"
|
|
5
|
+
},
|
|
2
6
|
"name": "@trylimbo/sdk-module-mxf",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
7
|
+
"version": "0.3.0-canary.41",
|
|
8
|
+
"license": "UNLICENSED",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/limboai/limbo-integrity.git",
|
|
12
|
+
"directory": "host/module/mxf/node/ffi"
|
|
13
|
+
},
|
|
14
|
+
"type": "module",
|
|
15
|
+
"types": "./gen/ffi/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./gen/ffi/index.d.ts",
|
|
19
|
+
"default": "./gen/ffi/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"gen/ffi/**/*"
|
|
24
|
+
],
|
|
25
|
+
"trylimbo": {
|
|
26
|
+
"lane": "ffi",
|
|
27
|
+
"role": "module",
|
|
28
|
+
"rust": {
|
|
29
|
+
"dir": "module/mxf"
|
|
30
|
+
},
|
|
31
|
+
"export": "mxf"
|
|
32
|
+
},
|
|
33
|
+
"engines": {
|
|
34
|
+
"node": ">=20"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"test": "node --test \"test/*.test.mjs\"",
|
|
38
|
+
"test:integration": "node --test \"integration/*.test.mjs\""
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@trylimbo/sdk-issuer": "^0.2.25",
|
|
42
|
+
"@trylimbo/sdk-verifier": "^0.2.25"
|
|
43
|
+
}
|
|
6
44
|
}
|
package/README.md
DELETED