wao 0.40.2 → 0.41.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/cjs/accounts-web.js +25 -0
- package/cjs/accounts.js +38 -0
- package/cjs/adaptor-base.js +504 -287
- package/cjs/adaptor-cf.js +42 -0
- package/cjs/ao-loader.js +1 -1
- package/cjs/ao.js +18 -6
- package/cjs/aoconnect-base.js +1010 -546
- package/cjs/aoconnect-cf.js +24 -0
- package/cjs/ar-remote.js +277 -0
- package/cjs/armem-base.js +822 -211
- package/cjs/armem-cf.js +128 -0
- package/cjs/armem.js +11 -5
- package/cjs/bar.js +511 -173
- package/cjs/car.js +37 -0
- package/cjs/cf-env.js +54 -0
- package/cjs/cf.js +76 -0
- package/cjs/cli.js +12 -6
- package/cjs/create.js +1 -1
- package/cjs/devs.js +53 -0
- package/cjs/dodb.js +116 -0
- package/cjs/hb.js +136 -53
- package/cjs/hyperbeam.js +85 -44
- package/cjs/keygen.js +94 -0
- package/cjs/run.js +4 -1
- package/cjs/server.js +40 -9
- package/cjs/storage-multi.js +525 -0
- package/cjs/tgql-d1.js +664 -0
- package/cjs/tgql.js +293 -172
- package/cjs/workspace/.claude/agents/tester.md +2 -2
- package/cjs/workspace/.claude/skills/build/SKILL.md +2 -2
- package/cjs/workspace/.claude/skills/test/SKILL.md +3 -2
- package/cjs/workspace/CLAUDE.md +2 -2
- package/cjs/workspace/README.md +1 -1
- package/cjs/workspace/docs/debug.md +9 -4
- package/cjs/workspace/docs/hyperbeam-devices.md +50 -1
- package/cjs/workspace/package.json +3 -3
- package/esm/accounts-web.js +14 -0
- package/esm/accounts.js +27 -0
- package/esm/adaptor-base.js +129 -31
- package/esm/adaptor-cf.js +11 -0
- package/esm/ao-loader.js +1 -1
- package/esm/ao.js +21 -2
- package/esm/aoconnect-base.js +248 -7
- package/esm/aoconnect-cf.js +9 -0
- package/esm/ar-remote.js +87 -0
- package/esm/armem-base.js +304 -53
- package/esm/armem-cf.js +67 -0
- package/esm/armem.js +7 -2
- package/esm/bar.js +126 -16
- package/esm/car.js +10 -0
- package/esm/cf-env.js +29 -0
- package/esm/cf.js +11 -0
- package/esm/cli.js +6 -2
- package/esm/create.js +1 -1
- package/esm/devs.js +15 -0
- package/esm/dodb.js +26 -0
- package/esm/hb.js +93 -16
- package/esm/hyperbeam.js +68 -30
- package/esm/keygen.js +47 -0
- package/esm/run.js +4 -1
- package/esm/server.js +29 -9
- package/esm/storage-multi.js +183 -0
- package/esm/tgql-d1.js +407 -0
- package/esm/tgql.js +29 -10
- package/esm/workspace/.claude/agents/tester.md +2 -2
- package/esm/workspace/.claude/skills/build/SKILL.md +2 -2
- package/esm/workspace/.claude/skills/test/SKILL.md +3 -2
- package/esm/workspace/CLAUDE.md +2 -2
- package/esm/workspace/README.md +1 -1
- package/esm/workspace/docs/debug.md +9 -4
- package/esm/workspace/docs/hyperbeam-devices.md +50 -1
- package/esm/workspace/package.json +3 -3
- package/package.json +10 -3
- package/postinstall.cjs +84 -0
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"version": "0.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"test": "node --
|
|
7
|
-
"test-only": "node --
|
|
8
|
-
"test-all": "node --
|
|
6
|
+
"test": "node --test --test-concurrency=1",
|
|
7
|
+
"test-only": "node --test-only --test-concurrency=1",
|
|
8
|
+
"test-all": "node --test --test-concurrency=1 test/**/*.test.js",
|
|
9
9
|
"start": "trap 'kill $(jobs -p)' EXIT; node dashboard/server.js & cd dashboard && npx vite",
|
|
10
10
|
"start:api": "node dashboard/server.js",
|
|
11
11
|
"keygen": "node scripts/keygen.js",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wao",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.41.0",
|
|
4
4
|
"bin": {
|
|
5
5
|
"wao": "./cjs/cli.js",
|
|
6
6
|
"wao-esm": "./esm/cli.js"
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
"require": "./cjs/web.js",
|
|
26
26
|
"import": "./esm/web.js"
|
|
27
27
|
},
|
|
28
|
+
"./cf": {
|
|
29
|
+
"require": "./cjs/cf.js",
|
|
30
|
+
"import": "./esm/cf.js"
|
|
31
|
+
},
|
|
28
32
|
"./signer": {
|
|
29
33
|
"require": "./cjs/signer.js",
|
|
30
34
|
"import": "./esm/signer.js"
|
|
@@ -67,9 +71,12 @@
|
|
|
67
71
|
"@babel/cli": "^7.24.8",
|
|
68
72
|
"@babel/core": "^7.25.2",
|
|
69
73
|
"@babel/plugin-transform-modules-commonjs": "^7.24.8",
|
|
70
|
-
"@babel/preset-env": "^7.25.3"
|
|
74
|
+
"@babel/preset-env": "^7.25.3",
|
|
75
|
+
"patch-package": "^8.0.1",
|
|
76
|
+
"postinstall-postinstall": "^2.1.0"
|
|
71
77
|
},
|
|
72
78
|
"scripts": {
|
|
73
|
-
"server": "node
|
|
79
|
+
"server": "node cjs/run.js",
|
|
80
|
+
"postinstall": "node postinstall.cjs || true"
|
|
74
81
|
}
|
|
75
82
|
}
|
package/postinstall.cjs
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Patch @permaweb/ao-loader@0.0.44 for Node 24+ wasm-memory64.
|
|
3
|
+
//
|
|
4
|
+
// patch-package can't reach ao-loader when it's hoisted out of
|
|
5
|
+
// node_modules/wao/node_modules/ (the default on modern npm). This script
|
|
6
|
+
// locates ao-loader via require.resolve and applies the same growMemory
|
|
7
|
+
// patch inline — idempotent, safe to run on already-patched files,
|
|
8
|
+
// fail-open if the file looks different from upstream.
|
|
9
|
+
|
|
10
|
+
const fs = require("fs")
|
|
11
|
+
const path = require("path")
|
|
12
|
+
|
|
13
|
+
function findAoLoader() {
|
|
14
|
+
try {
|
|
15
|
+
return require.resolve("@permaweb/ao-loader/dist/index.cjs", {
|
|
16
|
+
paths: [process.cwd(), __dirname, path.resolve(__dirname, "..")],
|
|
17
|
+
})
|
|
18
|
+
} catch (_) {}
|
|
19
|
+
// Fall back to scanning the closest node_modules/.
|
|
20
|
+
let dir = path.resolve(__dirname, "..")
|
|
21
|
+
while (dir !== "/" && dir !== "") {
|
|
22
|
+
const candidate = path.join(dir, "node_modules", "@permaweb", "ao-loader", "dist", "index.cjs")
|
|
23
|
+
if (fs.existsSync(candidate)) return candidate
|
|
24
|
+
dir = path.dirname(dir)
|
|
25
|
+
}
|
|
26
|
+
return null
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const target = findAoLoader()
|
|
30
|
+
if (!target) {
|
|
31
|
+
// Either ao-loader isn't installed (the consumer doesn't need it) or
|
|
32
|
+
// we couldn't locate it — fail-open.
|
|
33
|
+
process.exit(0)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const src = fs.readFileSync(target, "utf8")
|
|
37
|
+
|
|
38
|
+
if (src.includes("Node 24+ wasm-memory64")) {
|
|
39
|
+
// Already patched.
|
|
40
|
+
process.exit(0)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const OLD = ` var growMemory = (size) => {
|
|
44
|
+
var b = wasmMemory.buffer;
|
|
45
|
+
var pages = (size - b.byteLength + 65535) / 65536;
|
|
46
|
+
try {
|
|
47
|
+
wasmMemory.grow(pages);
|
|
48
|
+
updateMemoryViews();
|
|
49
|
+
return 1;
|
|
50
|
+
} catch (e) {
|
|
51
|
+
err(\`growMemory: Attempted to grow heap from \${b.byteLength} bytes to \${size} bytes, but got error: \${e}\`);
|
|
52
|
+
}
|
|
53
|
+
};`
|
|
54
|
+
|
|
55
|
+
const NEW = ` var growMemory = (size) => {
|
|
56
|
+
var b = wasmMemory.buffer;
|
|
57
|
+
// Node 24+ wasm-memory64: wasmMemory.grow needs an integer page
|
|
58
|
+
// count, and if the underlying memory is memory64, grow() expects
|
|
59
|
+
// a BigInt (Number args are rejected). Compute as integer pages,
|
|
60
|
+
// then try BigInt first and fall back to Number for memory32.
|
|
61
|
+
var pages = Math.ceil((size - b.byteLength + 65535) / 65536);
|
|
62
|
+
try {
|
|
63
|
+
try {
|
|
64
|
+
wasmMemory.grow(BigInt(pages));
|
|
65
|
+
} catch (_e) {
|
|
66
|
+
wasmMemory.grow(pages);
|
|
67
|
+
}
|
|
68
|
+
updateMemoryViews();
|
|
69
|
+
return 1;
|
|
70
|
+
} catch (e) {
|
|
71
|
+
err(\`growMemory: Attempted to grow heap from \${b.byteLength} bytes to \${size} bytes, but got error: \${e}\`);
|
|
72
|
+
}
|
|
73
|
+
};`
|
|
74
|
+
|
|
75
|
+
if (!src.includes(OLD)) {
|
|
76
|
+
// File doesn't match the expected upstream — likely a newer ao-loader
|
|
77
|
+
// version where the fix has been applied differently or upstream
|
|
78
|
+
// rewrote the function. Fail-open.
|
|
79
|
+
process.exit(0)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const out = src.split(OLD).join(NEW)
|
|
83
|
+
fs.writeFileSync(target, out)
|
|
84
|
+
console.error("wao postinstall: patched @permaweb/ao-loader growMemory for Node 24+ wasm-memory64")
|